-
Notifications
You must be signed in to change notification settings - Fork 125
Description
Summary
Test-ActionVersionConsistency.ps1 now produces JSON output to logs/action-version-consistency-results.json via the lint:version-consistency npm script (#987), but there is no dedicated GitHub Actions workflow to consume these results in CI. The other two security scanning scripts each have reusable workflow files that read JSON output, generate SARIF, upload to GitHub Security tab, publish artifacts, and surface job summaries.
Current Behavior
Running npm run lint:version-consistency writes JSON locally, but CI has no dedicated workflow to:
- Run the scan as a reusable workflow
- Upload SARIF results to the GitHub Security tab
- Publish JSON/SARIF as workflow artifacts
- Surface compliance metrics as job outputs
Expected Behavior
A new action-version-consistency-scan.yml reusable workflow that follows the established pattern from dependency-pinning-scan.yml and workflow-permissions-scan.yml:
- Accepts
workflow_callinputs forsoft-fail,upload-sarif, andupload-artifact - Runs
Test-ActionVersionConsistency.ps1with-Format Jsonand-Format Sarif - Extracts metrics (mismatch count, compliance) into job outputs
- Uploads SARIF to GitHub Security tab via
github/codeql-action/upload-sarif - Publishes results as workflow artifacts
- Generates a job summary
Reference Pattern
| Existing Workflow | Script |
|---|---|
.github/workflows/dependency-pinning-scan.yml |
Test-DependencyPinning.ps1 |
.github/workflows/workflow-permissions-scan.yml |
Test-WorkflowPermissions.ps1 |
The new workflow should mirror these patterns. Test-ActionVersionConsistency.ps1 already supports -Format Json, -Format Sarif, and -OutputPath parameters, so the script side is ready.
Files Requiring Changes
| File | Change |
|---|---|
.github/workflows/action-version-consistency-scan.yml |
New reusable workflow |
| Caller workflow(s) referencing the new scan | Wire up workflow_call invocation |
Prerequisite
- Enable JSON log output for
lint:version-consistencynpm script #987 — Enable JSON log output forlint:version-consistencynpm script
References
scripts/security/Test-ActionVersionConsistency.ps1— supports-Format Json|Sarif,-OutputPath,-FailOnMismatch.github/workflows/dependency-pinning-scan.yml— reference pattern.github/workflows/workflow-permissions-scan.yml— reference pattern