0
0
mirror of https://github.com/thegeeklab/wp-git-action.git synced 2024-06-02 18:29:41 +02:00

revert branch default handling

This commit is contained in:
Robert Kaussow 2024-05-05 22:26:11 +02:00
parent fbd0ab69ae
commit 1e36f94746
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
2 changed files with 1 additions and 6 deletions

View File

@ -46,12 +46,6 @@ func (p *Plugin) run(ctx context.Context) error {
func (p *Plugin) Validate() error {
var err error
// This default cannot be set in the cli flag, as the CI_* environment variables
// can be set empty, resulting in an empty default value.
if p.Settings.Repo.Branch == "" {
p.Settings.Repo.Branch = "main"
}
if p.Settings.Repo.WorkDir == "" {
p.Settings.Repo.WorkDir, err = os.Getwd()
}

View File

@ -141,6 +141,7 @@ func Flags(settings *Settings, category string) []cli.Flag {
Usage: "name of the git source branch",
EnvVars: []string{"PLUGIN_BRANCH"},
Destination: &settings.Repo.Branch,
Value: "main",
Category: category,
},
&cli.StringFlag{