Skip to content

Commit

Permalink
Add fast-forward workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaiducek authored and openshift-merge-bot[bot] committed Dec 20, 2023
1 parent 60e2b47 commit 14bb2bd
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/fast_forward.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Fast forward latest release

on:
push:
branches:
- main

jobs:
ff:
name: Fast forward from main to latest release branch
runs-on: ubuntu-latest
steps:
- name: Set Up Environment Variables
run: |
RELEASE_BRANCH="release-$(cut -d '.' -f 1,2 VERSION)"
echo "RELEASE_BRANCH=${RELEASE_BRANCH}" >> ${GITHUB_ENV}
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all tags and branches

- name: Fast-forward main to {{ env.RELEASE_BRANCH }}
run: |
git checkout {{ env.RELEASE_BRANCH }} || git checkout -b {{ env.RELEASE_BRANCH }}
git merge --ff-only origin/main
git push origin/{{ env.RELEASE_BRANCH }}
- name: Slack failure report
uses: slackapi/[email protected]
if: ${{ failure() }}
env:
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
SLACK_WEBHOOK_URL: ${{ secrets.CODE_HEALTH_SLACK_WEBHOOK }}
with:
payload: |
{"blocks": [{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":failed: Gatekeeper Operator fast-forwarding failed: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow run>"
}
}]}

0 comments on commit 14bb2bd

Please sign in to comment.