Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/test-auto-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ jobs:
repository: MapColonies/test-site
token: ${{ secrets.GH_PAT }}
ref: master
path: test-site
persist-credentials: false

- name: Create empty commit in test repo
working-directory: test-site
run: |
git config user.name "GitHub Actions Bot"
git config user.email "actions@github.com"
Expand All @@ -44,7 +46,7 @@ jobs:
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GH_PAT }}
repository: MapColonies/test-site
path: test-site
branch: "auto-merge-e2e-${{ github.sha }}"
base: master
title: 'chore: auto-merge e2e test'
Expand Down
6 changes: 6 additions & 0 deletions actions/auto-merge/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ runs:
run: |
set -euo pipefail
echo "Waiting for all checks on PR #${{ inputs.pr_number }} to complete"
# Checks of a just-opened PR take a few seconds to register; until then gh reports none and --watch exits 1.
for _ in $(seq 12); do
out=$(gh pr checks "${{ inputs.pr_number }}" --repo "${{ inputs.repository }}" --json name 2>&1) && break
grep -q 'no checks reported' <<< "$out" || { echo "$out" >&2; exit 1; }
sleep 5
done
if gh pr checks "${{ inputs.pr_number }}" \
--repo "${{ inputs.repository }}" \
--watch; then
Expand Down