Skip to content

ci: audit workflows with zizmor - #2002

Merged
hkad98 merged 1 commit into
gooddata:masterfrom
hkad98:jkd/harden-workflows
Nov 26, 2026
Merged

hkad98 merged 1 commit into
gooddata:masterfrom
hkad98:jkd/harden-workflows

Conversation

@hkad98

@hkad98 hkad98 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This adds zizmor to check the GitHub Actions workflows for security problems, and fixes the 83 findings it reported in the workflows and composite actions.

The check

  • .github/zizmor.yml holds the configuration. The self-repository rule is off, so the workflows can keep calling this repo's own actions and workflows as ./.github/....
  • rw-workflow-lint.yaml is a new reusable workflow. It downloads zizmor 1.33.1, checks the download against a checksum, and runs zizmor --offline --min-severity low ..
  • pre-merge.yaml runs it through a new lint-workflows job, which status-check waits on. A new workflows filter in rw-collect-changes.yaml makes the job run only when .github/ or .pre-commit-config.yaml changes.
  • A pre-commit hook runs the same version with the same arguments.

Fixes

  • Every third-party action now points at a fixed commit, with a comment naming the version.
  • Workflows default to permissions: {}, and each job gets only the access it uses.
  • rw-python-tests now receives only CODECOV_TOKEN instead of secrets: inherit.
  • The global npm install -g hugo-extended is removed. docs/package-lock.json already pins hugo-extended, so npm ci installs it and the build runs it with npx --no hugo.
  • The docs-deploy workflows call this repo's Hugo actions as ./.github/actions/... instead of gooddata/gooddata-python-sdk/...@master.

Suppressed inline, each with a comment giving the reason:

  • sdk-slash-commands and staging-tests are triggered by PR comments. Both already check the commenter before doing anything.
  • netlify-deploy-preview uses pull_request_target, but it only copies the Markdown under docs/content/en from the pull request.
  • bump-version and the merge action keep the checkout credentials on purpose, because they push afterwards.
  • rel-dev-back-merge still calls the merge action as @master, because the job has no checkout that a ./ path could use.

AGENTS.md describes the check and the rules it enforces.

Risk

nonprod: only CI and documentation change. The release, docs-deploy and back-merge workflows run only after merge or when started by hand, so this PR's checks don't exercise them. The first run of each should be watched.

Summary by CodeRabbit

  • Tests
    • Added automated checks for workflow configuration changes, alongside the existing test and validation jobs.
    • Staging tests can now be triggered by a pull request comment from an authorized contributor when the pull request comes from this repository.
  • Chores
    • Updated build, deployment, and release workflows, including their Hugo build steps and action versions.

zizmor flagged 83 findings in the workflows and composite actions at
low severity and above. Fix them and gate future changes on the audit.

The audit runs offline with --min-severity low, from a pre-commit hook
and from a new rw-workflow-lint job that pre-merge runs whenever
.github/ or the pre-commit config changes. Both use zizmor 1.33.1; CI
verifies the release checksum before running it.

Fixes:
- pin every third-party action to a commit SHA
- default workflow permissions to none and grant each job its scopes
- pass CODECOV_TOKEN by name instead of secrets: inherit
- install hugo from docs/package-lock.json instead of npm install -g
- call this repository's hugo actions as ./.github/actions/...

Suppressed inline, with the reason next to each: the comment-triggered
workflows, which check the commenter first; the docs preview on
pull_request_target, which takes only Markdown from the pull request;
the checkouts that keep credentials to push; and the back-merge job,
which has no checkout to resolve a local action from.

AGENTS.md documents the audit and the conventions it enforces.

jira: trivial
risk: nonprod
@hkad98
hkad98 requested review from lupko and pcerny as code owners November 26, 2026 13:23
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

This change updates GitHub Actions and local actions to use pinned action revisions, scoped permissions, and environment-based input passing. It also adds conditional zizmor auditing when workflow-related files change and connects that audit to pre-merge checks.

Changes: GitHub Actions hardening

Layer / File(s) Summary
Local action builds and input handling
.github/actions/hugo-build-action/action.yaml, .github/actions/hugo-build-versioned-action/action.yaml, .github/actions/merge/action.yaml
The Hugo actions run the lockfile-provided binary through npx. The build and merge scripts receive selected inputs through environment variables. Action references are pinned to commit SHAs.
Release and deployment workflows
.github/workflows/build-release.yaml, .github/workflows/bump-version.yaml, .github/workflows/fossa.yaml, .github/workflows/netlify-deploy*.yaml
These workflows pin action references and set workflow or job permissions. Netlify builds use the local Hugo action or invoke the lockfile-provided Hugo binary.
Workflow change detection and audit
.github/workflows/rw-collect-changes.yaml, .github/workflows/pre-merge.yaml, .github/workflows/rw-workflow-lint.yaml, .github/zizmor.yml, .pre-commit-config.yaml, AGENTS.md, .github/workflows/rel-dev-back-merge.yaml, .github/workflows/sdk-slash-commands.yaml
Change collection reports whether workflow-related files changed. Pre-merge passes that result to a reusable workflow that installs and runs zizmor. The repository adds zizmor configuration, a pre-commit hook, audit guidance, and targeted suppressions.
Test gates and event workflows
.github/workflows/rw-python-tests.yaml, .github/workflows/pre-merge.yaml, .github/workflows/sdk-review-relay.yml, .github/workflows/staging-tests.yaml
The Python test workflow accepts an optional Codecov token and pins its actions. Pre-merge limits permissions and secrets and waits for workflow lint and Python tests. Review-relay and staging-test workflows update permissions, input handling, or triggers.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Suggested reviewers: mara3l, no23reason, tychtjan

Merge Risk: Minimal · up to e01bd

This change hardens CI workflows and adds a workflow security audit. No concrete defect was identified, and the first runs of the release, docs-deploy, and back-merge workflows are worth watching after merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "ci: audit workflows with zizmor" matches the main change. The PR adds zizmor auditing for GitHub Actions workflows and composite actions, with a pre-commit hook, a reusable lint workflow, a…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "ci: audit workflows with zizmor" matches the main change. The PR adds zizmor auditing for GitHub Actions workflows and composite actions, with a pre-commit hook, a reusable lint workflow, and a CI job. The title is short, uses a conventional commit prefix, and names the primary change. It does not mention the SHA pinning, permission hardening, or secret handling, but the title does not need to cover every detail.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the action trail,
And pins each step along the way.
It nibbles leaves beside the tests,
While workflow checks run clear and true.
Then hops past Hugo, pleased with npx.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 90df55f3-9e88-4a17-9b26-f6af20b81669
Commits

Reviewing files that changed from the base of the PR and between 84f5e1e and e01bd82.

Files selected for processing: 20

  • .github/actions/hugo-build-action/action.yaml
  • .github/actions/hugo-build-versioned-action/action.yaml
  • .github/actions/merge/action.yaml
  • .github/workflows/build-release.yaml
  • .github/workflows/bump-version.yaml
  • .github/workflows/fossa.yaml
  • .github/workflows/netlify-deploy-preview.yaml
  • .github/workflows/netlify-deploy-v2.yaml
  • .github/workflows/netlify-deploy.yaml
  • .github/workflows/pre-merge.yaml
  • .github/workflows/rel-dev-back-merge.yaml
  • .github/workflows/rw-collect-changes.yaml
  • .github/workflows/rw-python-tests.yaml
  • .github/workflows/rw-workflow-lint.yaml
  • .github/workflows/sdk-review-relay.yml
  • .github/workflows/sdk-slash-commands.yaml
  • .github/workflows/staging-tests.yaml
  • .github/zizmor.yml
  • .pre-commit-config.yaml
  • AGENTS.md

Included review availability: This review used your included allowance. 1 included review remains after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

@hkad98
hkad98 merged commit f702214 into gooddata:master Nov 26, 2026
9 checks passed
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.

2 participants