Add milestone to metadata (#5174)

This commit is contained in:
6543
2025-09-01 16:12:54 +02:00
committed by GitHub
parent 3366c4c118
commit c5a5bbea5d
13 changed files with 195 additions and 153 deletions

View File

@@ -108,6 +108,7 @@ func (m *Metadata) Environ() map[string]string {
setNonEmptyEnvVar(params, "CI_COMMIT_TARGET_BRANCH", targetBranch)
setNonEmptyEnvVar(params, "CI_COMMIT_PULL_REQUEST", pullRegexp.FindString(pipeline.Commit.Ref))
setNonEmptyEnvVar(params, "CI_COMMIT_PULL_REQUEST_LABELS", strings.Join(pipeline.Commit.PullRequestLabels, ","))
setNonEmptyEnvVar(params, "CI_COMMIT_PULL_REQUEST_MILESTONE", pipeline.Commit.PullRequestMilestone)
}
// Only export changed files if maxChangedFiles is not exceeded

View File

@@ -61,15 +61,16 @@ type (
// Commit defines runtime metadata for a commit.
Commit struct {
Sha string `json:"sha,omitempty"`
Ref string `json:"ref,omitempty"`
Refspec string `json:"refspec,omitempty"`
Branch string `json:"branch,omitempty"`
Message string `json:"message,omitempty"`
Author Author `json:"author,omitempty"`
ChangedFiles []string `json:"changed_files,omitempty"`
PullRequestLabels []string `json:"labels,omitempty"`
IsPrerelease bool `json:"is_prerelease,omitempty"`
Sha string `json:"sha,omitempty"`
Ref string `json:"ref,omitempty"`
Refspec string `json:"refspec,omitempty"`
Branch string `json:"branch,omitempty"`
Message string `json:"message,omitempty"`
Author Author `json:"author,omitempty"`
ChangedFiles []string `json:"changed_files,omitempty"`
PullRequestLabels []string `json:"labels,omitempty"`
PullRequestMilestone string `json:"milestone,omitempty"`
IsPrerelease bool `json:"is_prerelease,omitempty"`
}
// Author defines runtime metadata for a commit author.