-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
35 additions
and
47 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +0,0 @@ | ||
name: Merge Queue Tests | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- merge-queue-test | ||
pull_request: | ||
branches: | ||
- master | ||
- merge-queue-test | ||
merge_group: | ||
|
||
jobs: | ||
verify_merge: | ||
# Below if lets it run as a required check but skip on normal push/PR events | ||
if: ${{ github.event_name == 'merge_group' }} | ||
name: Verify map merge sanity | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
# allegedly this is as deep as necessary to always receive the base ref | ||
fetch-depth: 2 | ||
|
||
- name: Verify map merge | ||
run: | | ||
# assume we're at the head ref and give it a name we know | ||
git switch -c gh/mergequeue/head | ||
# go back to the base ref and attempt our own merge | ||
git checkout ${{ github.event.merge_group.base_sha }} | ||
git switch -c gh/mergequeue/base | ||
git merge gh/mergequeue/head | ||
# the merge was not concluded cleanly | ||
if [ -e ".git/MERGE_HEAD" ]; then | ||
echo "Merge state detected; manual resolution most likely required" | ||
exit 1 | ||
fi | ||
# if our merge was clean but our's and GitHubs differ, then complain | ||
if [[ `git diff --exit-code gh/mergequeue/head` ]]; then | ||
echo "Queue merge does not match driver merge; manual resolution most likely required" | ||
exit 1 | ||
fi | ||