0
0
mirror of https://github.com/thegeeklab/wp-plugin-go.git synced 2024-11-24 03:00:40 +00:00

fix: fix env vars to fetch metadata urls (#14)

This commit is contained in:
Robert Kaussow 2023-08-16 08:36:06 +02:00 committed by GitHub
parent 87ca9df3f4
commit 7c3ed98b56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -56,7 +56,7 @@ func pipelineFlags(category string) []cli.Flag {
&cli.StringFlag{ &cli.StringFlag{
Name: "pipeline.link", Name: "pipeline.link",
Usage: "pipeline link", Usage: "pipeline link",
EnvVars: []string{"CI_PIPELINE_LINK"}, EnvVars: []string{"CI_PIPELINE_URL"},
Category: category, Category: category,
}, },
&cli.StringFlag{ &cli.StringFlag{

View File

@ -20,6 +20,7 @@ import (
// Repository defines runtime metadata for a repository. // Repository defines runtime metadata for a repository.
type Repository struct { type Repository struct {
Slug string `json:"slug,omitempty"`
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`
Owner string `json:"owner,omitempty"` Owner string `json:"owner,omitempty"`
Link string `json:"link,omitempty"` Link string `json:"link,omitempty"`
@ -30,6 +31,12 @@ type Repository struct {
func repositoryFlags(category string) []cli.Flag { func repositoryFlags(category string) []cli.Flag {
return []cli.Flag{ return []cli.Flag{
&cli.StringFlag{
Name: "repo.slug",
Usage: "repo slug",
EnvVars: []string{"CI_REPO"},
Category: category,
},
&cli.StringFlag{ &cli.StringFlag{
Name: "repo.name", Name: "repo.name",
Usage: "repo name", Usage: "repo name",
@ -45,7 +52,7 @@ func repositoryFlags(category string) []cli.Flag {
&cli.StringFlag{ &cli.StringFlag{
Name: "repo.link", Name: "repo.link",
Usage: "repo link", Usage: "repo link",
EnvVars: []string{"CI_REPO_LINK"}, EnvVars: []string{"CI_REPO_URL"},
Category: category, Category: category,
}, },
&cli.StringFlag{ &cli.StringFlag{
@ -71,6 +78,7 @@ func repositoryFlags(category string) []cli.Flag {
func repositoryFromContext(c *cli.Context) Repository { func repositoryFromContext(c *cli.Context) Repository {
return Repository{ return Repository{
Slug: c.String("repo.slug"),
Name: c.String("repo.name"), Name: c.String("repo.name"),
Owner: c.String("repo.owner"), Owner: c.String("repo.owner"),
Link: c.String("repo.link"), Link: c.String("repo.link"),

View File

@ -44,7 +44,7 @@ func systemFlags(category string) []cli.Flag {
&cli.StringFlag{ &cli.StringFlag{
Name: "system.link", Name: "system.link",
Usage: "system link", Usage: "system link",
EnvVars: []string{"CI_SYSTEM_LINK"}, EnvVars: []string{"CI_SYSTEM_URL"},
Category: category, Category: category,
}, },
&cli.StringFlag{ &cli.StringFlag{