Merge upstream branches #12398
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Merge upstream branches | |
on: | |
schedule: | |
- cron: '7 * * * *' | |
jobs: | |
merge: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Merge upstream | |
run: | | |
git config --global user.name 'Katka92' | |
git config --global user.email 'kkanova@redhat.com' | |
# "git checkout master" is unnecessary, already here by default | |
git pull --unshallow # this option is very important, you would get | |
# complains about unrelated histories without it. | |
# (but actions/checkout@v2 can also be instructed | |
# to fetch all git depth right from the start) | |
git remote add upstream https://github.com/redhat-appstudio/infra-deployments.git | |
git fetch upstream | |
git merge upstream/main | |
git push origin main | |
- name: Slack alert on merge failure | |
if: failure() | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
CHANNEL_ID: "C04U7TA1BT8" # forum-rhtap-test-execution-alerts | |
run: | | |
curl -H "Authorization: Bearer ${SLACK_BOT_TOKEN}" -d "text=:alert-siren: infra-deployments upstream merge job failed" -d "channel=${CHANNEL_ID}" -X POST https://slack.com/api/chat.postMessage |