diff --git a/.github/workflows/update-pr-stack.yml b/.github/workflows/update-pr-stack.yml index 87cf4ea..86f030c 100644 --- a/.github/workflows/update-pr-stack.yml +++ b/.github/workflows/update-pr-stack.yml @@ -9,6 +9,13 @@ permissions: contents: write pull-requests: write +# Serialize runs per PR: the push that finishes a conflict resolution fires a +# synchronize event while the conflict label is still attached, so without a +# group the follow-up run races the one that triggered it. +concurrency: + group: update-pr-stack-${{ github.event.pull_request.number }} + cancel-in-progress: false + jobs: update-pr-stack: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 6e19752..f0737ae 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,10 @@ on: pull_request: types: [closed, synchronize] +concurrency: + group: update-pr-stack-${{ github.event.pull_request.number }} + cancel-in-progress: false + jobs: update-pr-stack: runs-on: ubuntu-latest @@ -110,6 +114,10 @@ permissions: contents: write pull-requests: write +concurrency: + group: update-pr-stack-${{ github.event.pull_request.number }} + cancel-in-progress: false + jobs: update-pr-stack: runs-on: ubuntu-latest diff --git a/tests/test_e2e.sh b/tests/test_e2e.sh index 420f2cd..b6e9f19 100755 --- a/tests/test_e2e.sh +++ b/tests/test_e2e.sh @@ -558,7 +558,7 @@ wait_for_synchronize_workflow() { log_cmd gh run view "$target_run_id" --repo "$REPO_FULL_NAME" --log || echo >&2 "Could not fetch logs for run $target_run_id" return 1 fi - elif [[ "$run_status" == "queued" || "$run_status" == "in_progress" || "$run_status" == "waiting" ]]; then + elif [[ "$run_status" == "queued" || "$run_status" == "in_progress" || "$run_status" == "waiting" || "$run_status" == "pending" ]]; then echo >&2 "Workflow $target_run_id is $run_status. Sleeping $sleep_time seconds." else echo >&2 "Workflow $target_run_id has unexpected status: $run_status. Conclusion: $run_conclusion" @@ -665,7 +665,7 @@ wait_for_workflow() { log_cmd gh run view "$target_run_id" --repo "$REPO_FULL_NAME" --log || echo >&2 "Could not fetch logs for run $target_run_id" return 1 fi - elif [[ "$run_status" == "queued" || "$run_status" == "in_progress" || "$run_status" == "waiting" ]]; then + elif [[ "$run_status" == "queued" || "$run_status" == "in_progress" || "$run_status" == "waiting" || "$run_status" == "pending" ]]; then echo >&2 "Workflow $target_run_id is $run_status. Sleeping $sleep_time seconds." else echo >&2 "Workflow $target_run_id has unexpected status: $run_status. Conclusion: $run_conclusion"