update vulcanus/aquilo #247
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: automerge | |
on: | |
pull_request_target: | |
types: [opened, edited] | |
paths-ignore: ['.github/**/*', '.github'] | |
jobs: | |
checkEdits: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout pull request branch on forked repo | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
ref: ${{github.event.pull_request.head.ref}} | |
repository: ${{github.event.pull_request.head.repo.full_name}} | |
token: ${{ github.token }} | |
- name: Check for blacklisted edits | |
run: | | |
#!/bin/bash | |
head=$(git rev-parse --abbrev-ref HEAD) | |
echo - head: $head | |
main=$(git merge-base $head origin/main) | |
echo - main: $main | |
diff_cmd="git diff --name-only $head $main" | |
echo - diff_cmd: $diff_cmd | |
diffs=$($diff_cmd) | |
echo '- diff_cmd result (below):' | |
echo $diffs | |
echo '- forbidden edits (below):' | |
if grep -i '\.github' <<<$diffs; then | |
exit 1; | |
else | |
exit 0; | |
fi | |
automerge: # https://github.com/marketplace/actions/merge-pull-requests-automerge-action | |
needs: checkEdits | |
runs-on: ubuntu-latest | |
steps: | |
- name: automerge | |
uses: "pascalgn/[email protected]" | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
MERGE_LABELS: "" | |
MERGE_DELETE_BRANCH: true |