Skip to content

Commit b9de8ea

Browse files
Jonathan D.A. Jewellclaude
andcommitted
feat: accept VERISIMDB_PAT for cross-repo dispatch
Update scan-and-report reusable workflow to accept optional VERISIMDB_PAT secret for repository_dispatch to verisimdb-data. Falls back to GITHUB_TOKEN if PAT not configured. Adds -sf to curl for silent failure detection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e91aac2 commit b9de8ea

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
description: 'Path to scan (default: .)'
1010
default: '.'
1111
type: string
12+
secrets:
13+
VERISIMDB_PAT:
14+
description: 'PAT with repo scope for cross-repo dispatch to verisimdb-data'
15+
required: false
1216
workflow_dispatch:
1317

1418
permissions:
@@ -39,13 +43,14 @@ jobs:
3943
- name: Send to verisimdb-data
4044
if: steps.scan.outputs.scan_complete == 'true'
4145
env:
42-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
DISPATCH_TOKEN: ${{ secrets.VERISIMDB_PAT || secrets.GITHUB_TOKEN }}
4347
run: |
4448
REPO_NAME=$(basename $(pwd))
4549
SCAN_DATA=$(cat scan-result.json)
4650
47-
curl -X POST \
48-
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
51+
curl -sf -X POST \
52+
-H "Authorization: Bearer ${DISPATCH_TOKEN}" \
4953
-H "Accept: application/vnd.github+json" \
5054
"https://api.github.com/repos/hyperpolymath/verisimdb-data/dispatches" \
5155
-d "{\"event_type\":\"scan_result\",\"client_payload\":{\"repo_name\":\"$REPO_NAME\",\"scan_data\":$SCAN_DATA}}"
56+
echo "Dispatched scan results for ${REPO_NAME} to verisimdb-data"

0 commit comments

Comments
 (0)