Skip to content

Commit

Permalink
Merge pull request #173502 from Homebrew/fix-automerge-from-merge_queue
Browse files Browse the repository at this point in the history
automerge-from-merge-queue: fix
  • Loading branch information
carlocab committed Jun 2, 2024
2 parents 5e12469 + ec2ffac commit 956599d
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/automerge-from-merge-queue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ jobs:
... on WorkflowRun {
checkSuite {
commit {
associatedPullRequests(last: 1) {
parents(last: 2) {
nodes {
number
associatedPullRequests(last: 1) {
nodes {
number
}
}
}
}
}
Expand All @@ -67,12 +71,21 @@ jobs:
}
}
run: |
# Get the latest PR associated with the second parent of the merge commit created for the merge_group.
number="$(
gh api graphql \
--field url="$WORKFLOW_RUN_URL" \
--raw-field query="$QUERY" \
--jq '.data.resource.checkSuite.commit.associatedPullRequests.nodes[].number'
--jq '.data.resource.checkSuite.commit.parents.nodes |
last.associatedPullRequests.nodes[].number'
)"
if [[ -z "$number" ]]
then
echo "::error::Missing PR number!"
exit 1
fi
echo "number=$number" >> "$GITHUB_OUTPUT"
- name: Check PR labels and timeline for merge queue events
Expand Down

0 comments on commit 956599d

Please sign in to comment.