Skip to content

Commit

Permalink
githubaction: Use correct config name for files
Browse files Browse the repository at this point in the history
Also support old name "bump_files"
  • Loading branch information
wader committed Sep 16, 2023
1 parent 2d05939 commit 97c52b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions internal/github/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 8 additions & 4 deletions internal/githubaction/githubaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
}
Expand All @@ -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)

Expand Down

0 comments on commit 97c52b4

Please sign in to comment.