further tweak CI #8
Workflow file for this run
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
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 |