Skip to content

[s] Mergequeue map test 2 #5

[s] Mergequeue map test 2

[s] Mergequeue map test 2 #5

Workflow file for this run

name: Merge Queue Tests
on:
merge_group:
push:
pull_request:
jobs:
verify_merge:
name: Verify map merge sanity
runs-on: ubuntu-latest
# Below if lets it run as a required check but skip on normal push/PR events
if: ${{ github.event_name == 'merge_group'}}
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