Skip to content

Instantly share code, notes, and snippets.

@Mic92
Created July 24, 2022 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mic92/41ac74e9ba77e61a49392aaab74b1767 to your computer and use it in GitHub Desktop.
Save Mic92/41ac74e9ba77e61a49392aaab74b1767 to your computer and use it in GitHub Desktop.
name: Automatic merge if CI builds
on:
push:
branches:
- 'update/*'
jobs:
wait-for-check-regexp:
runs-on: ubuntu-latest
if: github.actor == 'numtide-bot'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
- name: Wait on tests
uses: lewagon/wait-on-check-action@v1.1.2
with:
ref: ${{ github.sha }}
repo-token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
running-workflow-name: wait-for-check-regexp
check-regexp: (check|devShell).+
verbose: true
- name: Automerge
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git checkout master
git merge ${GITHUB_REF#refs/heads/}
# attempt to reduce race condition if some other ci job already pushed in the meantime
git pull --rebase origin master
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment