Skip to content

Commit 81c0aa2

Browse files
committed
fix(canon-quality): align PR comment with enforcement gate and harden scope input
- Render comment now treats PARTIAL_INDEX as non-blocking even in hard mode, matching the enforcement gate which only fails on FINDINGS. Adds a PARTIAL_INDEX-specific footer in hard mode and selects the warning icon when the job will not fail. - Resolve scope step passes github.event.inputs.scope_paths via env (INPUT_SCOPE_PATHS) instead of interpolating into the shell body, eliminating the quoting hazard and shell injection vector under workflow_dispatch.
1 parent 2d9d09a commit 81c0aa2

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/canon-quality.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ jobs:
4949
steps:
5050
- name: Resolve scope
5151
id: scope
52+
env:
53+
INPUT_SCOPE_PATHS: ${{ github.event.inputs.scope_paths }}
5254
run: |
53-
if [ -n "${{ github.event.inputs.scope_paths }}" ]; then
54-
PATHS='${{ github.event.inputs.scope_paths }}'
55+
if [ -n "$INPUT_SCOPE_PATHS" ]; then
56+
PATHS="$INPUT_SCOPE_PATHS"
5557
else
5658
PATHS='["writings/"]'
5759
fi
@@ -189,7 +191,10 @@ jobs:
189191
lines.append('')
190192
lines.append(f'No dead `klappy://` references or legacy link patterns found in `{paths_label}`. {summary.get("files_scanned", 0)} files scanned.')
191193
else:
192-
icon = '⚠️' if mode == 'soft' else '❌'
194+
# Per the audit spec, PARTIAL_INDEX is non-blocking even in hard mode
195+
# (best-effort findings, retry on next push). Only FINDINGS fails in hard.
196+
will_fail = mode == 'hard' and status == 'FINDINGS'
197+
icon = '❌' if will_fail else '⚠️'
193198
lines.append(f'### Canon Quality — `oddkit_audit` {icon}')
194199
lines.append('')
195200
total = summary.get('total_findings', len(findings))
@@ -229,6 +234,8 @@ jobs:
229234
lines.append('')
230235
if mode == 'soft':
231236
lines.append('> **Soft-block mode** — this status is informational. The job will not fail. Hard-block ships in PR-3.2 after the observation cycle.')
237+
elif status == 'PARTIAL_INDEX':
238+
lines.append('> **Hard-block mode** — `PARTIAL_INDEX` is non-blocking per the audit spec (best-effort findings, retry on next push). The job will not fail on this status.')
232239
else:
233240
lines.append('> **Hard-block mode** — this PR will fail until findings are resolved. Fix the dead references or add a line-level allowlist directive (`<!-- audit-allow: dead-reference reason="..." -->`) above the offending link.')
234241

0 commit comments

Comments
 (0)