1
0
mirror of https://github.com/helm/chart-testing.git synced 2026-02-05 09:45:14 +01:00

Add since flag for changing the reference branch for git merge-base (#229)

This commit is contained in:
Marc Sensenich
2020-07-24 16:12:55 -04:00
committed by GitHub
parent 67ec12d315
commit 93b10e8e55
11 changed files with 15 additions and 7 deletions

View File

@@ -675,7 +675,7 @@ func (t *Testing) computeMergeBase() (string, error) {
if err != nil {
return "", errors.New("Must be in a git repository")
}
return t.git.MergeBase(fmt.Sprintf("%s/%s", t.config.Remote, t.config.TargetBranch), "HEAD")
return t.git.MergeBase(fmt.Sprintf("%s/%s", t.config.Remote, t.config.TargetBranch), t.config.Since)
}
// ComputeChangedChartDirectories takes the merge base of HEAD and the configured remote and target branch and computes a

View File

@@ -41,6 +41,7 @@ var (
type Configuration struct {
Remote string `mapstructure:"remote"`
TargetBranch string `mapstructure:"target-branch"`
Since string `mapstructure:"since"`
BuildId string `mapstructure:"build-id"`
LintConf string `mapstructure:"lint-conf"`
ChartYamlSchema string `mapstructure:"chart-yaml-schema"`

View File

@@ -1,6 +1,7 @@
{
"remote": "origin",
"target-branch": "master",
"since": "HEAD~1",
"build-id": "pr-42",
"lint-conf": "my-lint-conf.yaml",
"chart-yaml-schema": "my-chart-yaml-schema.yaml",

View File

@@ -1,5 +1,6 @@
remote: origin
target-branch: master
since: HEAD~1
build-id: pr-42
lint-conf: my-lint-conf.yaml
chart-yaml-schema: my-chart-yaml-schema.yaml