Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,15 @@ jobs:
# PRs (see SDLC skill), so the Claude PR review is redundant on self-repo.
# Consumers using pr-review.yml in their own projects WILL run this normally —
# the skip only fires when github.repository matches the wizard repo exactly.
# Both slugs are listed on purpose. A GitHub rename does not rewrite this
# string: the redirect covers web and git, not a literal comparison inside a
# workflow. With only the old slug here, renaming the repo would silently
# flip this condition true and start running the paid self-review on our own
# PRs — burning quota with nothing to indicate anything had changed. Listing
# both makes the rename a no-op for this gate, in either direction.
if: |
github.repository != 'BaseInfinity/claude-sdlc-wizard' &&
github.repository != 'BaseInfinity/claude-sdlc-harness' &&
((github.event.action == 'opened' && github.event.pull_request.draft != true) ||
github.event.action == 'synchronize' ||
github.event.action == 'ready_for_review' ||
Expand Down
26 changes: 18 additions & 8 deletions tests/test-self-pr-review-skip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,24 @@ if [ ! -f "$WORKFLOW" ]; then
exit 1
fi

# Test 1: Workflow has the EXACT NEGATIVE comparison `github.repository != 'BaseInfinity/claude-sdlc-wizard'`.
# A literal `==` would invert the semantics (skip consumers, run on self) — must catch that.
# Use single-line grep with the actual operator embedded in the pattern.
if grep -qE "github\.repository[[:space:]]*!=[[:space:]]*['\"]BaseInfinity/claude-sdlc-wizard['\"]" "$WORKFLOW"; then
pass "Workflow uses exact negative comparison: github.repository != 'BaseInfinity/claude-sdlc-wizard'"
else
fail "Workflow must use exact: github.repository != 'BaseInfinity/claude-sdlc-wizard' — verify operator and string both"
fi
# Test 1: Workflow has the EXACT NEGATIVE comparison for EVERY slug this repo
# answers to. A literal `==` would invert the semantics (skip consumers, run on
# self) — must catch that.
#
# Both the current and the planned slug are required, because a GitHub rename
# does NOT rewrite this string. The condition would silently start matching, and
# the paid self-review this skip exists to prevent would begin running on our own
# PRs — costing quota with no signal that anything changed. GitHub redirects web
# and git operations; it does not redirect a literal comparison inside a
# workflow. Listing both slugs makes the rename a no-op for this gate, in either
# direction, so it can be flipped without a flag day.
for slug in "BaseInfinity/claude-sdlc-wizard" "BaseInfinity/claude-sdlc-harness"; do
if grep -qE "github\.repository[[:space:]]*!=[[:space:]]*['\"]${slug}['\"]" "$WORKFLOW"; then
pass "Workflow uses exact negative comparison: github.repository != '$slug'"
else
fail "Workflow must use exact: github.repository != '$slug' — verify operator and string both"
fi
done

# Test 1b: Negative control — explicitly fail if `==` operator is used (would skip consumers).
if grep -qE "github\.repository[[:space:]]*==[[:space:]]*['\"]BaseInfinity/claude-sdlc-wizard['\"]" "$WORKFLOW"; then
Expand Down