Skip to content

Commit 0baffed

Browse files
d-morrisonclaude
andcommitted
fix: address review on prompt + skip-cp-setup (PR #81)
- quarto-review.prompt.md: convert checklist item 8's three comma-separated validation steps to a bullet list, per the repo's own bullet-list rule. - copilot-setup-steps.yml: pass the event name and label-contains expression through env vars in the skip check rather than interpolating them into the shell, the GitHub-recommended pattern against expression injection. (The `paths:` filter does not block the skip-cp-setup label: Copilot invokes copilot-setup-steps directly when provisioning its environment, independent of the `on:` triggers, so the label is honored there.) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9807548 commit 0baffed

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

.github/prompts/quarto-review.prompt.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ Review checklist:
2929
7. No generated files are edited (`README.md` from `README.Rmd`; `_site/`,
3030
`_freeze/`, `.quarto/`), and spell/link-check failures are fixed at the
3131
source (wordlist or content), not suppressed.
32-
8. The author ran the required local validation: render of the touched page,
33-
`lintr`, and `spelling::spell_check_package()`.
32+
8. The author ran the required local validation:
33+
- render of the touched page
34+
- `lintr`
35+
- `spelling::spell_check_package()`
3436

3537
Output format:
3638

.github/workflows/copilot-setup-steps.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,18 @@ jobs:
4646
# (e.g. metadata- or workflow-only PRs). Non-PR events always run setup.
4747
- name: Check if setup should be skipped
4848
id: check_label
49+
# Pass the expression result through env (GitHub-recommended) rather
50+
# than interpolating it directly into the shell, to avoid the
51+
# expression-injection anti-pattern in code that downstream books copy.
52+
env:
53+
EVENT_NAME: ${{ github.event_name }}
54+
LABELS_CONTAIN_SKIP: ${{ contains(github.event.pull_request.labels.*.name, 'skip-cp-setup') }}
4955
shell: bash
5056
run: |
51-
if [[ '${{ github.event_name }}' != 'pull_request' ]]; then
57+
if [[ "$EVENT_NAME" != 'pull_request' ]]; then
5258
echo "Not a pull request, running full setup"
5359
echo "skip=false" >> "$GITHUB_OUTPUT"
54-
elif [[ '${{ contains(github.event.pull_request.labels.*.name, 'skip-cp-setup') }}' == 'true' ]]; then
60+
elif [[ "$LABELS_CONTAIN_SKIP" == 'true' ]]; then
5561
echo "skip-cp-setup label present, skipping setup steps"
5662
echo "skip=true" >> "$GITHUB_OUTPUT"
5763
else

0 commit comments

Comments
 (0)