Skip to content

Commit 37dcb98

Browse files
sawenzelclaude
andcommitted
Count the sentinel only when it is modified
This fixes the gate step skipping a pull request that adds test/needs-o2-dev rather than edits it. - Opting into the source build means editing the existing sentinel, so the check now uses a Modified-only file list. - The pull request introducing the sentinel adds it, and so tripped its own opt-out and passed without running any test. - The relevance check still uses the full list, so deletions keep counting. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 5f64b37 commit 37dcb98

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/sim-tests.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ jobs:
6565
run: |
6666
set -eu
6767
changed=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA")
68-
if grep -qx 'test/needs-o2-dev' <<< "$changed" ; then
68+
# Opting in means *editing* the existing sentinel, so only count it
69+
# when it is Modified. A pull request that Adds it — which is what the
70+
# pull request introducing the sentinel does — would otherwise trip its
71+
# own opt-out and pass without testing anything.
72+
opted=$(git diff --name-only --diff-filter=M "$BASE_SHA" "$HEAD_SHA")
73+
if grep -qx 'test/needs-o2-dev' <<< "$opted" ; then
6974
echo "::notice title=Skipped::this pull request touches test/needs-o2-dev, so it is tested by build/O2DPG/sim/o2dev against O2 dev instead"
7075
echo "skip=true" >> "$GITHUB_OUTPUT"
7176
elif ! grep -qE '^(DATA/|MC/|test/|RelVal/)' <<< "$changed" ; then

0 commit comments

Comments
 (0)