1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2026-06-03 16:35:37 +02:00

Add CI_PIPELINE_RERUNS environment variable (#6588)

This commit is contained in:
Eric Zhou
2026-05-18 01:13:23 +08:00
committed by GitHub
parent c331e1c93d
commit 8905b8fa53
9 changed files with 132 additions and 95 deletions
@@ -77,6 +77,9 @@ func (m *Metadata) Environ() map[string]string {
setNonEmptyEnvVar(params, "CI_PIPELINE_STARTED", strconv.FormatInt(pipeline.Started, 10))
setNonEmptyEnvVar(params, "CI_PIPELINE_AUTHOR", pipeline.Author)
setNonEmptyEnvVar(params, "CI_PIPELINE_AVATAR", pipeline.Avatar)
if pipeline.RerunCount > 0 {
setNonEmptyEnvVar(params, "CI_PIPELINE_RERUNS", strconv.FormatInt(pipeline.RerunCount, 10))
}
workflow := m.Workflow
setNonEmptyEnvVar(params, "CI_WORKFLOW_NAME", workflow.Name)
+1
View File
@@ -56,6 +56,7 @@ type (
DeployTask string `json:"task,omitempty"`
Commit Commit `json:"commit"`
Parent int64 `json:"parent,omitempty"`
RerunCount int64 `json:"rerun_count,omitempty"`
Cron string `json:"cron,omitempty"`
Author string `json:"author,omitempty"`
Avatar string `json:"avatar,omitempty"`