ci: Automate rebasing dev #131
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: sync main with dev | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
defaults: | |
run: | |
shell: bash -x -e -u -o pipefail {0} | |
jobs: | |
sync-branches-via-rebase: | |
runs-on: ubuntu-latest | |
name: syncing main with dev | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: ko3n1g/dev | |
- name: Attempt rebase | |
run: | | |
git fetch origin main | |
git rebase origin/main | |
git push --force | |
notify: | |
runs-on: ubuntu-latest | |
if: failure() | |
needs: [sync-branches-via-rebase] | |
env: | |
RUN_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
SLACK_WEBHOOK_ADMIN: "<!subteam^${{ secrets.SLACK_WEBHOOK_ADMIN }}>" | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: NVIDIA/NeMo-FW-CI-templates | |
ref: v0.5.0 | |
path: send-slack-alert | |
- name: Send Slack alert | |
uses: ./send-slack-alert/.github/actions/send-slack-alert | |
with: | |
message: > | |
<${{ env.RUN_URL }}|sync main with dev> has failed for. | |
cc: ${{ env.SLACK_WEBHOOK_ADMIN }} | |
webhook: ${{ env.SLACK_WEBHOOK }} | |