Skip to content

Commit 780a578

Browse files
fix(ci): hypatia-scan.yml -- --exit-zero + GITHUB_TOKEN (hyperpolymath/hypatia#213) (#18)
Mirrors hyperpolymath/hypatia#228 in this consumer repo. ## What was actually broken in `Hypatia Security Scan` The scanner halts with `System.halt(1)` whenever findings exist at or above the severity threshold (`lib/hypatia/cli.ex:158-160` pre-#228). Under GitHub Actions' default `set -e`, that exit-1 short-circuits the workflow step before `jq` aggregation, `actions/upload-artifact`, the PR comment, AND the explicit "Check for critical or high-severity issues" step. The previous `actions/upload-artifact` SHA-bump sweep across the estate (41 PRs) was based on a wrong diagnosis -- the failing runs were not at action-resolve time. See hyperpolymath/hypatia#213 for the full root-cause writeup. ## Changes in this PR - **Pass `GITHUB_TOKEN`** to the scan step env so the Dependabot rule can query alerts (and stops emitting `Warning: Dependabot alerts unavailable: GITHUB_TOKEN not set`). - **Append `--exit-zero`** to the `hypatia-cli.sh scan .` invocation so findings-at-severity no longer short-circuits the step. The downstream "Check for critical or high-severity issues" step (already in this workflow) remains the explicit gate. - **Pin `actions/upload-artifact` to v4.6.2** (`ea165f8d65b6e75b540449e92b4886f43607fa02`) to match the estate-wide pin. ## Notes - `--exit-zero` was added in hyperpolymath/hypatia#228 and is silently ignored by pre-#228 versions of the scanner (OptionParser strict mode places unknown flags in `invalid` and the CLI discards that), so this PR is safe to merge in either order relative to #228. - This change does not affect non-CI usage of the scanner; the default `exit 1` on findings is unchanged for shell / pre-commit users. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent f6db41b commit 780a578

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/hypatia-scan.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,14 @@ jobs:
5353
5454
- name: Run Hypatia scan
5555
id: scan
56+
env:
57+
# Suppress the Dependabot "GITHUB_TOKEN not set" warning.
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5659
run: |
5760
echo "Scanning repository: ${{ github.repository }}"
5861
5962
# Run scanner
60-
HYPATIA_FORMAT=json "$HOME/hypatia/hypatia-cli.sh" scan . > hypatia-findings.json
63+
HYPATIA_FORMAT=json "$HOME/hypatia/hypatia-cli.sh" scan . --exit-zero > hypatia-findings.json
6164
6265
# Count findings
6366
FINDING_COUNT=$(jq '. | length' hypatia-findings.json 2>/dev/null || echo 0)
@@ -79,7 +82,7 @@ jobs:
7982
echo "- Medium: $MEDIUM" >> $GITHUB_STEP_SUMMARY
8083
8184
- name: Upload findings artifact
82-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
85+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
8386
with:
8487
name: hypatia-findings
8588
path: hypatia-findings.json

0 commit comments

Comments
 (0)