Skip to content

Commit 14acbea

Browse files
ci(validate-marketplace): guard SARIF upload on file presence
apm-action's audit-report step short-circuits when there is no apm.lock.yaml ('No apm.lock.yaml found -- nothing to scan') and writes no SARIF file. The unconditional upload step then failed with 'Path does not exist: apm-audit.sarif'. Marketplace-only manifests legitimately have no dependencies to scan, so the absence of a SARIF file is not an error -- only its presence-with-failures would be. Guard the upload on hashFiles('apm-audit.sarif') != '' so the gate stays green for marketplace-only repos and lights up the moment awesome-copilot adds a real dependency. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 95a972f commit 14acbea

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/validate-marketplace.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,21 @@ jobs:
6868
audit-report: 'true'
6969

7070
# Gate A: supply-chain integrity (consumer-side).
71+
# `apm audit --ci` exits non-zero on policy failures (lockfile drift,
72+
# orphan packages, hidden Unicode in deployed content). On a
73+
# marketplace-only manifest with no `dependencies:` block this is a
74+
# short-circuit pass ("No dependencies declared -- lockfile not
75+
# required"), but the gate is wired so the moment awesome-copilot
76+
# adds a real dependency the policy fires automatically.
7177
- name: apm audit --ci
7278
run: apm audit --ci
7379

80+
# SARIF upload only runs when apm-action actually produced a report.
81+
# For marketplace-only manifests there is no lockfile to scan, so
82+
# apm-action emits "No apm.lock.yaml found -- nothing to scan" and
83+
# writes no file. Guarding on hashFiles() avoids a spurious failure.
7484
- name: Upload APM audit SARIF
75-
if: always()
85+
if: always() && hashFiles('apm-audit.sarif') != ''
7686
uses: github/codeql-action/upload-sarif@v3
7787
with:
7888
sarif_file: apm-audit.sarif

0 commit comments

Comments
 (0)