From 47b9b0a7471d96b6777eada5484820b3ae28ef7f Mon Sep 17 00:00:00 2001 From: Mattias Wadman Date: Sat, 16 Sep 2023 16:50:04 +0200 Subject: [PATCH] githubaction: Use correct config name for files Also support old name "bump_files" Was wrong in 7e394457914f7b576b5b3cbc3c127e394393116e --- internal/github/action.go | 3 +++ internal/githubaction/githubaction.go | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/internal/github/action.go b/internal/github/action.go index 96391a5..1b6a014 100644 --- a/internal/github/action.go +++ b/internal/github/action.go @@ -65,6 +65,9 @@ func NewActionEnv(getenv GetenvFn, version string) (*ActionEnv, error) { return nil, err } repositoryParts := strings.SplitN(repository, "/", 2) + if len(repositoryParts) < 2 { + return nil, fmt.Errorf("GITHUB_REPOSITORY has invalid value %q", repository) + } client := &Client{ Token: token, diff --git a/internal/githubaction/githubaction.go b/internal/githubaction/githubaction.go index 7a4ce2b..742fb03 100644 --- a/internal/githubaction/githubaction.go +++ b/internal/githubaction/githubaction.go @@ -118,7 +118,9 @@ func (c Command) run() []error { return []error{fmt.Errorf("GITHUB_SHA not set")} } - files, _ := ae.Input("bump_files") + // support "bump_files" for backward compatibility + bumpFiles, _ := ae.Input("bump_files") + files, _ := ae.Input("files") var bumpfile, titleTemplate, commitBodyTemplate, @@ -159,8 +161,10 @@ func (c Command) run() []error { } // TODO: whitespace in filenames - filesParts := strings.Fields(files) - bfs, errs := bump.NewBumpFileSet(c.OS, all.Filters(), bumpfile, filesParts) + var filenames []string + filenames = append(filenames, strings.Fields(bumpFiles)...) + filenames = append(filenames, strings.Fields(files)...) + bfs, errs := bump.NewBumpFileSet(c.OS, all.Filters(), bumpfile, filenames) if errs != nil { return errs } @@ -185,7 +189,7 @@ func (c Command) run() []error { continue } - fmt.Printf(" Updateable to %s\n", check.Latest) + fmt.Printf(" Updatable to %s\n", check.Latest) templateReplacerFn := CheckTemplateReplaceFn(check)