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:
@@ -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
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user