Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
update .github/workflows/automerge.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
web3-bot committed Jun 1, 2021
1 parent e6dd8fb commit cec22c7
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,35 @@
# This reduces the friction associated with updating with our workflows.

on: [ pull_request ]
name: Automerge

jobs:
automerge:
automerge-check:
if: github.event.pull_request.user.login == 'web3-bot'
runs-on: ubuntu-latest
outputs:
status: ${{ steps.should-automerge.outputs.status }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Check if we should automerge
id: should-automerge
run: |
for commit in $(git rev-list --first-parent origin/${{ github.event.pull_request.base.ref }}..${{ github.event.pull_request.head.sha }}); do
committer=$(git show --format=$'%ce' -s $commit)
echo "Committer: $committer"
if [[ "$committer" != "web3-bot@users.noreply.github.com" ]]; then
echo "Commit $commit wasn't committed by web3-bot, but by $committer."
echo "::set-output name=status::false"
exit
fi
done
echo "::set-output name=status::true"
automerge:
needs: automerge-check
runs-on: ubuntu-latest
if: ${{ needs.automerge-check.outputs.status == 'true' }}
steps:
- name: Wait on tests
uses: lewagon/wait-on-check-action@bafe56a6863672c681c3cf671f5e10b20abf2eaa # v0.2
Expand Down

0 comments on commit cec22c7

Please sign in to comment.