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
4 changes: 4 additions & 0 deletions .github/scripts/apply-repo-settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,8 @@ echo "Enabling secret scanning non-provider patterns ..."

"$SCRIPT_DIR/apply-secret-scanning-non-provider-patterns.sh"

echo "Applying code-quality required-status-checks ruleset ..."

"$SCRIPT_DIR/apply-code-quality-ruleset.sh"

echo "Done — repository settings applied: https://github.com/$REPO/settings"
4 changes: 4 additions & 0 deletions .github/scripts/tests/apply-repo-settings.bats
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ SCRIPT="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)/apply-repo-settings.s
@test "script wires in secret_scanning_non_provider_patterns enablement (issue #227)" {
grep -q 'apply-secret-scanning-non-provider-patterns.sh' "$SCRIPT"
}

@test "script wires in code-quality ruleset application (issue #375)" {
grep -q 'apply-code-quality-ruleset.sh' "$SCRIPT"
}
Comment on lines +33 to +35

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Assert the actual ruleset invocation, not just the filename.

This test would pass if apply-code-quality-ruleset.sh appeared in a comment or unrelated string. Match the executable command used by .github/scripts/apply-repo-settings.sh so the test detects broken wiring.

Suggested assertion
 `@test` "script wires in code-quality ruleset application (issue `#375`)" {
-  grep -q 'apply-code-quality-ruleset.sh' "$SCRIPT"
+  grep -qF '"$SCRIPT_DIR/apply-code-quality-ruleset.sh"' "$SCRIPT"
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@test "script wires in code-quality ruleset application (issue #375)" {
grep -q 'apply-code-quality-ruleset.sh' "$SCRIPT"
}
`@test` "script wires in code-quality ruleset application (issue `#375`)" {
grep -qF '"$SCRIPT_DIR/apply-code-quality-ruleset.sh"' "$SCRIPT"
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/scripts/tests/apply-repo-settings.bats around lines 33 - 35, Update
the test “script wires in code-quality ruleset application (issue `#375`)” to
assert the actual executable invocation used by apply-repo-settings.sh,
including its command context and expected arguments, rather than only matching
the apply-code-quality-ruleset.sh filename. Keep the assertion focused on
detecting whether the script truly invokes the ruleset command.

1 change: 1 addition & 0 deletions .github/workflows/apply-repo-settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
branches: [main]
paths:
- .github/scripts/apply-repo-settings.sh
- .github/scripts/apply-code-quality-ruleset.sh
- .github/workflows/apply-repo-settings.yml

permissions: {}
Expand Down
Loading