diff --git a/pipeline/frontend/metadata/environment.go b/pipeline/frontend/metadata/environment.go index 25ac55d31..1ab3b22e2 100644 --- a/pipeline/frontend/metadata/environment.go +++ b/pipeline/frontend/metadata/environment.go @@ -71,7 +71,7 @@ func (m *Metadata) Environ() map[string]string { "CI_COMMIT_SHA": m.Curr.Commit.Sha, "CI_COMMIT_REF": m.Curr.Commit.Ref, "CI_COMMIT_REFSPEC": m.Curr.Commit.Refspec, - "CI_COMMIT_BRANCH": m.Curr.Commit.Branch, + "CI_COMMIT_BRANCH": sourceBranch, "CI_COMMIT_SOURCE_BRANCH": sourceBranch, "CI_COMMIT_TARGET_BRANCH": targetBranch, "CI_COMMIT_MESSAGE": m.Curr.Commit.Message, @@ -103,7 +103,7 @@ func (m *Metadata) Environ() map[string]string { "CI_PREV_COMMIT_SHA": m.Prev.Commit.Sha, "CI_PREV_COMMIT_REF": m.Prev.Commit.Ref, "CI_PREV_COMMIT_REFSPEC": m.Prev.Commit.Refspec, - "CI_PREV_COMMIT_BRANCH": m.Prev.Commit.Branch, + "CI_PREV_COMMIT_BRANCH": prevSourceBranch, "CI_PREV_COMMIT_URL": m.Prev.ForgeURL, "CI_PREV_COMMIT_MESSAGE": m.Prev.Commit.Message, "CI_PREV_COMMIT_AUTHOR": m.Prev.Commit.Author.Name,