-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
41 lines (37 loc) · 1.35 KB
/
merge_queue.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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