Skip to content

Commit 2889fc2

Browse files
hyperpolymathclaude
andcommitted
fix(ci): scan-and-report — skip verisimdb dispatch without VERISIMDB_PAT; surface HTTP status on rejection
VERISIMDB_PAT is declared optional (required: false), but consumers without it fell through to GITHUB_TOKEN, which can never dispatch to another repo — so every such consumer's Security Scan went red at the dispatch step with a bare curl exit 22 (seen on echidna run 28842498410 once the argv overflow from #155 was out of the way). - No PAT -> notice + skip dispatch; the scan result itself still gates. - With PAT -> capture and report the HTTP status + response body on rejection instead of a silent -f failure. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 906781f commit 2889fc2

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

.github/workflows/scan-and-report.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,17 @@ jobs:
4444
- name: Send to verisimdb-data
4545
if: steps.scan.outputs.scan_complete == 'true'
4646
env:
47-
DISPATCH_TOKEN: ${{ secrets.VERISIMDB_PAT || secrets.GITHUB_TOKEN }}
47+
DISPATCH_TOKEN: ${{ secrets.VERISIMDB_PAT }}
4848
run: |
49+
# VERISIMDB_PAT is declared optional. Cross-repo dispatch is
50+
# impossible with the workflow's own GITHUB_TOKEN (it is scoped
51+
# to the calling repo), so without the PAT we skip rather than
52+
# fail every consumer's Security Scan.
53+
if [ -z "${DISPATCH_TOKEN}" ]; then
54+
echo "::notice::VERISIMDB_PAT not configured; scan passed, skipping cross-repo dispatch to verisimdb-data"
55+
exit 0
56+
fi
57+
4958
REPO_NAME=$(basename $(pwd))
5059
5160
# Build the payload in a file: inlining the scan JSON on argv
@@ -73,9 +82,15 @@ jobs:
7382
}}}' scan-result.json > dispatch-payload.json
7483
fi
7584
76-
curl -sf -X POST \
85+
# Capture the HTTP status so a rejected dispatch says *why*
86+
# instead of a bare curl exit 22.
87+
HTTP_STATUS=$(curl -s -o dispatch-response.json -w "%{http_code}" -X POST \
7788
-H "Authorization: Bearer ${DISPATCH_TOKEN}" \
7889
-H "Accept: application/vnd.github+json" \
7990
"https://api.github.com/repos/hyperpolymath/verisimdb-data/dispatches" \
80-
--data @dispatch-payload.json
81-
echo "Dispatched scan results for ${REPO_NAME} to verisimdb-data"
91+
--data @dispatch-payload.json)
92+
if [ "${HTTP_STATUS}" -ge 300 ]; then
93+
echo "::error::verisimdb-data dispatch failed with HTTP ${HTTP_STATUS}: $(cat dispatch-response.json)"
94+
exit 1
95+
fi
96+
echo "Dispatched scan results for ${REPO_NAME} to verisimdb-data (HTTP ${HTTP_STATUS})"

0 commit comments

Comments
 (0)