Skip to content

ci: harden GitHub Actions workflows (FB-4904) - #550

Merged
fstr merged 4 commits into
mainfrom
ci/FB-4904-harden-actions
Oct 16, 2026
Merged

fstr merged 4 commits into
mainfrom
ci/FB-4904-harden-actions

Conversation

@fstr

@fstr fstr commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Upgraded and SHA-pinned all actions with pinact (7-day min age); repinned action-python-release to current main (README-only change).
  • Every workflow now defaults to permissions: {}; jobs (and reusable-workflow caller jobs) get only what they need.
  • persist-credentials: false on all checkouts except the release job, which keeps true because the release action pushes the version commit and tag.
  • Docs deploy job: removed the pip cache (cache poisoning on a contents: write job), moved ${{ }} out of run:, quoted shell variables. Added lint-and-scan-actions.yml (actionlint + zizmor) plus .github/actionlint.yaml to ignore the intentional cache-mode key, which actionlint doesn't know yet.

Action upgrades with changes

  • actions/setup-python v6 → v7 and actions/cache v5 → v6: no input changes needed (v7 drops pip-install, which isn't used).

Scan results

zizmor: 17 → 10 findings (10 low self-repository, which suggests $/… instead of ./… for local reusable workflows; actionlint rejects that syntax, so it stays). actionlint: 10 → 0 errors (cache-mode ignored via config).

Follow-up fixes

  • check-pr-formatting.yml: skip the title check for Dependabot by PR author (github.event.pull_request.user.login != 'dependabot[bot]') instead of startsWith(github.head_ref, 'dependabot'), which anyone could match by naming their branch.
  • Added .github/zizmor.yml to disable self-repository (actionlint rejects the $/ syntax). zizmor now reports no findings.

Part of FB-4904.

🤖 Generated with Claude Code


Note

Medium Risk
Touches every CI workflow including release and integration tests; permission and checkout credential changes could break jobs if mis-scoped, though release push behavior is explicitly preserved.

Overview
Hardens GitHub Actions across the repo: workflows default to permissions: {}, with least-privilege grants on individual jobs (including reusable-workflow callers), persist-credentials: false on checkouts except release (which still needs push), and SHA-pinned action bumps (e.g. checkout v7.0.1, setup-python v7) plus pinact config to avoid auto-bumping the Firebolt integration-testing major ref.

Adds .github/workflows/lint-and-scan-actions.yml (actionlint + zizmor on .github/** changes) with actionlint/zizmor config to tolerate intentional keys (cache-mode on code-check) and keep local reusable workflow paths as ./.github/....

Targeted workflow fixes: docs deploy drops pip cache on the contents: write job and hardens shell/env usage; PR semantic title skips Dependabot by PR author instead of branch name; code-check sets cache-mode: none; minor shell quoting and artifact/action version updates elsewhere.

Reviewed by Cursor Bugbot for commit 2a989ef. Bugbot is set up for automated code reviews on this repo. Configure here.

- Upgrade and SHA-pin actions (pinact, 7-day min age); repin
  action-python-release to current main.
- Default every workflow to `permissions: {}` and grant per-job
  permissions, including on reusable-workflow caller jobs.
- Set `persist-credentials: false` on checkouts that don't push; the
  release job keeps `true` for the version bump and tag push.
- Drop the pip cache from the docs deploy job (cache poisoning) and move
  template expressions in `run:` into `env:`; quote shell variables.
- Add actionlint + zizmor CI workflow and an actionlint config that
  ignores the intentional `cache-mode` job key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fstr
fstr requested a review from a team as a code owner October 16, 2026 13:38
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

fstr and others added 3 commits October 16, 2026 16:06
pinact -u ignores Dependabot's semver-major ignore and moves v1 callers of
integration-testing-setup to v2, a different product with different inputs.
Exclude the action from pinact; Dependabot keeps it updated within its major.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
startsWith(github.head_ref, 'dependabot') matches any branch named
dependabot*, so anyone could skip the check by naming their branch so.
Check the PR author instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Disable the self-repository audit: actionlint does not support the
suggested `uses: $/...` syntax yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2a989ef. Configure here.

Comment thread .github/zizmor.yml
# reusable workflows, but actionlint does not support it yet and fails on it.
# Keep the workspace-relative `./.github/workflows/...` form until it does.
self-repository:
disable: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zizmor config breaks the scan job

High Severity

.github/zizmor.yml disables self-repository, but zizmor-action v0.6.0 runs zizmor 1.27.0, which does not know that audit (added in 1.30.0). zizmor rejects unknown rules keys, so the scan job fails to start instead of applying the suppression.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2a989ef. Configure here.

@fstr
fstr merged commit 275b444 into main Oct 16, 2026
17 checks passed
@fstr
fstr deleted the ci/FB-4904-harden-actions branch October 16, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants