fix(ci): make shannon-scan workflow resilient to tool install failures#23
fix(ci): make shannon-scan workflow resilient to tool install failures#23
Conversation
Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
|
@copilot Read first and treat as authoritative:
Your task is to harden the closed-loop repo-architect execution system so it is operationally trustworthy rather than merely plausible. Do not stop at analysis. Current weak points to fix
Required implementation changes A. Make delegation verifiable Implement delegation so the system can prove what happened. Required behavior:
Do not treat “label added” alone as proof of actual execution. Update docs and tests accordingly. B. Strengthen issue-to-PR linkage Implement stronger PR association than plain Use as many reliable signals as are available and practical, in priority order:
When repo-architect delegates an issue, ensure the issue body/comment includes the machine-readable linkage material Copilot should carry into the PR. When reconciling, prefer exact machine linkage over loose textual inference. Update tests for:
C. Replace interpretive lifecycle states with factual states Do not encode assumptions as labels or state names. Replace or refactor lifecycle/state handling so facts are represented directly, for example:
The exact naming can differ, but it must separate:
Do not label a closed unmerged PR as superseded unless there is explicit evidence of a superseding issue/PR. Planning may infer that stale work should be deprioritized, but the stored state must remain factual. D. Tighten reconciliation rules Update reconcile_pr_state() so it:
Persist reconciliation evidence in work state. E. Update work state schema Extend
Keep the schema machine-readable and documented. F. Update operator docs Document:
G. Update tests Add or update hermetic tests for:
Constraints
Success condition This task is complete only when:
When done, output a concise summary with these headings:
|
... This request is for PR KeygraphHQ#65 in |
The
gauGo module fails to install in CI due to authentication issues, causing the entire workflow to abort and leaving./resultsuncreated — which then cascades into SARIF write and upload failures.Changes
continue-on-error: trueto the "Install reconnaissance tools" step and appended|| trueto eachgo installcommand so bash's-emode doesn't short-circuit remaining tool installs when one failsmkdir -p resultsat the top of the "Generate SARIF Report" step (alreadyif: always()) so the SARIF write never hitsENOENTwhen upstream steps failOriginal prompt
Problem
The Shannon Security Scan workflow (
.github/workflows/shannon-scan.yml) is failing with cascading errors. See the failing run: https://github.com/Steake/shannon-uncontained/actions/runs/23126056183/job/67169218331Error 1 (Root Cause):
gauGo module installation failsIn the "Install reconnaissance tools" step (line 71-80),
go install github.com/tomnomnom/gau/v2/cmd/gau@latestfails with:The Go module's upstream repository has authentication issues (likely moved or requires auth), causing the step to exit with code 1.
Error 2: SARIF file write fails with ENOENT
The "Generate SARIF Report" step (line 96-122) runs with
if: always()but tries to write to./results/shannon-results.sarif. Since earlier steps failed, the./resultsdirectory was never created (themkdir -p resultson line 92 is in the "Run LSG Reconnaissance" step which also failed). This causes:Error 3: SARIF upload fails
The "Upload SARIF to GitHub Security" step fails because the SARIF file was never created:
Required Fixes
Fix 1: Make reconnaissance tool installation resilient
Add
continue-on-error: trueto the "Install reconnaissance tools" step so that a single tool failure (likegau) doesn't break the entire workflow. Additionally, install each Go tool individually with|| trueso one failing tool doesn't prevent the others from installing:Fix 2: Ensure
./resultsdirectory exists before SARIF generationAdd
mkdir -p resultsat the beginning of the "Generate SARIF Report" step so it works even when previous steps fail:Both fixes should be applied to the file
.github/workflows/shannon-scan.yml.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Investigate and fix
Assistant:
I'll start by investigating the failing job to understand what went wrong.
Assistant: Let me look at the workflow file to understand the full configuration:
Assistant: Here's my investigation of the failing Shannon Security Scan workflow run.
Root Cause Analysis
There are 3 cascading errors, all stemming from a single root cause:
1. ❌
go install github.com/tomnomnom/gau/v2/cmd/gau@latestfails (Root Cause)Step: "Install reconnaissance tools" (line 71–80)
The Go module
gauis trying to access a private or moved Git repository, and the runner can't authenticate interactively. This causes the step to exit with code 1.2. ❌
writeFileSync→ENOENT: no such file or directory, open './results/shannon-results.sarif'Step: "Generate SARIF Report" (line 96–122)
Because the previous "Run LSG Reconnaissance" step also failed (it depends on the recon tools), the
mkdir -p resultson line 92 likely never executed. Thenode -escript on line 99 tries to write to./results/shannon-results.sarif, but the./resultsdirectory doesn't exist.3. ❌
Path does not exist: ./results/shannon-results.sarifStep: "Upload SARIF to GitHub Security" (line 124–128)
Since the SARIF file was never created, the CodeQL upload also fails.
Fixes Needed
There are two issues to address in
.github/workflows/shannon-scan.yml:Fix 1:
gauinstallation failureThe
gauGo module's upstream repo appears to have authentication issues (possibly moved or requires auth). Options:@latest(e.g.,@v2.2.3).continue-on-error: trueto the recon tools step so a single tool failure doesn't break the entire workflow.gauif it's not essential, or install it via a pre-built binary release instead ofgo install.Fix 2: Ensure
./resultsdirectory exists before SARIF generationThe "Generate SARIF Report" step runs with
if: always()but depends on the./resultsdirectory being created. Add `mkdir -p re...This pull request was created from Copilot chat.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.