Skip to content

Commit

Permalink
fix: Add INPUT_GITHUB_SHA_BEFORE for check multi commits
Browse files Browse the repository at this point in the history
  • Loading branch information
anarcher committed Mar 28, 2020
1 parent 30e49bf commit dd82dd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ type GitHub struct {
}

type Inputs struct {
Paths []string `env:"INPUT_PATHS" envSeparator:"\n"`
Paths []string `env:"INPUT_PATHS" envSeparator:"\n"`
CommitBefore string `env:"INPUT_GITHUB_SHA_BEFORE"`
}

type Config struct {
Expand Down
5 changes: 3 additions & 2 deletions pkg/finder/gitchanged.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type GitChanged struct {
}

const (
gitDiffTreeFmt = "diff-tree --no-commit-id --name-only -r %s"
gitDiffTreeFmt = "diff-tree --no-commit-id --name-only -r %s %s"
kustomizeFileName = "kustomization.yaml"
)

Expand Down Expand Up @@ -51,7 +51,8 @@ func (f *GitChanged) PathFind() ([]string, error) {

func (f *GitChanged) gitDiffTree() ([]string, error) {
cmt := f.cfg.GitHub.Commit
args := fmt.Sprintf(gitDiffTreeFmt, cmt)
cmtBefore := f.cfg.Inputs.CommitBefore
args := fmt.Sprintf(gitDiffTreeFmt, cmt, cmtBefore)

out, err := f.cmd.Run("git", strings.Split(args, " ")...)
if err != nil {
Expand Down

0 comments on commit dd82dd3

Please sign in to comment.