Skip to content

Commit

Permalink
schutzbot: Fast-forward release branch after green main run
Browse files Browse the repository at this point in the history
The release branch can be tracked by stage deployments to make sure CI
is green before deploying to stage.
  • Loading branch information
croissanne authored and ondrejbudai committed Sep 2, 2022
1 parent a6e11b6 commit 6a2e719
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions schutzbot/update_github_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ curl \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/osbuild/osbuild-composer/statuses/${CI_COMMIT_SHA}" \
-d '{"state":"'"${GITHUB_NEW_STATE}"'", "description": "'"${GITHUB_NEW_DESC}"'", "context": "Schutzbot on GitLab", "target_url": "'"${CI_PIPELINE_URL}"'"}'

# ff release branch on github if this ran on main
if [ "$CI_COMMIT_BRANCH" = "main" ] && [ "$GITHUB_NEW_STATE" = "success" ]; then
git remote add github "https://${SCHUTZBOT_LOGIN#*:}@github.com/osbuild/osbuild-composer.git"
# || true to ignore non fast-forwards
git push github "${CI_COMMIT_SHA}:refs/heads/release" || true
fi

0 comments on commit 6a2e719

Please sign in to comment.