Skip to content

Commit 5fe1d64

Browse files
authored
[ci] Fix "Check test expectations" step so it checks out the target branch (#23220)
1 parent 91f9825 commit 5fe1d64

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828

2929
check-expectations:
3030
runs-on: ubuntu-latest
31+
if: github.event_name == 'pull_request'
3132
steps:
3233
- name: Checkout repo
3334
uses: actions/checkout@v4
@@ -52,14 +53,15 @@ jobs:
5253
echo "JS_ENGINES = [NODE_JS]" >> $EM_CONFIG
5354
echo "final config:"
5455
cat $EM_CONFIG
55-
- name: Check test expectations on main
56+
- name: Check test expectations on target branch
5657
run: |
57-
git checkout origin/main
58+
git checkout ${{ github.base_ref }}
59+
git rev-parse HEAD
5860
# Hack to honor changes to rebaseline_tests.py in the current PR
5961
git checkout - ./tools/maint/rebaseline_tests.py
6062
./bootstrap
6163
if ! ./tools/maint/rebaseline_tests.py --check-only; then
62-
echo "Test expectations are out-of-date on the main branch."
64+
echo "Test expectations are out-of-date on the target branch."
6365
echo "You can run `./tools/maint/rebaseline_tests.py --new-branch`"
6466
echo "and use it to create a seperate PR."
6567
exit 1

0 commit comments

Comments
 (0)