feat: OpenSSF Scorecard and dependency review workflows#33
Conversation
scorecard.yml: - Runs weekly (Monday 06:00 UTC), on push to main, and on workflow_dispatch - Publishes results to the OpenSSF database (public repo, OIDC-signed) - Uploads SARIF to GitHub Security tab and as a retained artifact - Target score >= 8.0/10 per issue #29 acceptance criteria dependency-review.yml: - Triggers on PRs touching any supported lockfile format - Reusable via workflow_call with fail-on-severity and deny-licenses inputs - Posts a summary comment on the PR via comment-summary-in-pr: always - Default deny list: GPL-2.0, GPL-3.0, AGPL-3.0 Also brings .pre-commit-config.yaml forward from issue-25 branch so local hooks work while that PR is pending merge. All action references SHA-pinned per #25 authoring standards. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds organization-governance workflows to improve supply-chain security posture for this repository and to provide a reusable dependency gate for consuming repositories.
Changes:
- Introduces an OpenSSF Scorecard workflow that runs on schedule/push and uploads SARIF results to GitHub Security.
- Adds a reusable Dependency Review workflow (also runnable on PRs) with severity/license policy inputs.
- Adds a local
.pre-commit-config.yamlto runactionlintandzizmorconsistently.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.pre-commit-config.yaml |
Adds pre-commit hooks for action/workflow linting and security checks. |
.github/workflows/scorecard.yml |
Runs OpenSSF Scorecard and uploads SARIF/artifacts for Security tab visibility. |
.github/workflows/dependency-review.yml |
Adds dependency review gate (PR + reusable workflow) with policy inputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code ReviewStrengths
Issues1. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
gh api repos/actions/upload-artifact/commits/v4 --jq '.sha'2. No - uses: github/codeql-action/upload-sarif@...
with:
sarif_file: scorecard-results.sarifIf the Scorecard action exits non-zero (rate-limited, transient failure), the SARIF upload will be skipped. Adding 3. Duplicate defaults for
4. Blocking only on 5. The list is comprehensive but misses a few patterns for completeness as a general-purpose org template:
Not critical for Sparkgeo's current stack — flagging for awareness. 6. As noted in the PR description, this file is identical to the one in PR #32. Whichever PR merges second will need a no-op conflict resolution. Merge PR #32 first to avoid the conflict landing here. Priority before merging
Items 3 and 4 are policy/cleanup calls; items 5 and 6 are low priority. |
scorecard.yml: - Remove redundant workflow-level permissions: read-all; job-level block is definitive (job permissions override, not merge, workflow-level) - Add if: always() to SARIF upload so results are captured even on transient Scorecard failures dependency-review.yml: - Raise fail-on-severity default from critical to high — CVSS 8.x findings should not pass silently in a security-focused org library - Add pdm.lock, mix.lock, Package.resolved to lockfile path filter - Expose comment-summary-in-pr as a workflow_call input (default: on-failure) so callers can control PR comment verbosity; avoids requiring pull-requests: write for callers that don't want comments Note: upload-artifact v7.0.1 SHA (043fb46d) is confirmed correct — v7.0.1 is the current latest release of actions/upload-artifact. The || fallback pattern on inputs.* is intentional and necessary: inputs.default is only applied on workflow_call; pull_request-triggered runs receive an empty string from the inputs context, requiring the fallback to supply the default value. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
Implements the code-deliverable items from issue #29 (enterprise governance and observability).
scorecard.yml— weekly OpenSSF Scorecard analysis; publishes results to the OpenSSF database and uploads SARIF to the GitHub Security tabdependency-review.yml— blocks PRs that introduce dependencies with known vulnerabilities or denied licenses; reusable viaworkflow_callNotes
.pre-commit-config.yamlis included here to keep local hooks working while PR Add workflow authoring standards, actionlint/zizmor gate, and CONTRIB… #32 (issue feat: workflow authoring standards + actionlint/zizmor gate #25) is pending merge; the file is identical — no conflict on mergepublish_results: trueon Scorecard works becausesparkgeo/github-actionsis a public repo; results will appear on the OpenSSF Scorecard dashboardGPL-2.0, GPL-3.0, AGPL-3.0) match Sparkgeo's commercial use requirements — adjust via thedeny-licensesinput in consuming reposOrg-level items remaining in #29 (not implementable as code)
Closes #29
Test plan
actionlint+zizmorpass)