ci(workflows): add zizmor audit and harden workflows#885
Conversation
Agent-Logs-Url: https://github.com/sanity-io/plugins/sessions/da24fdd7-a31b-4868-a333-0d2d9e6006d9 Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
@copilot
Replace secrets: inherit with explicit pass-through
The reusable workflow only declares two required secrets (ECOSPARK_APP_ID and ECOSPARK_APP_PRIVATE_KEY). Forward only those:
secrets:
ECOSPARK_APP_ID: ${{ secrets.ECOSPARK_APP_ID }}
ECOSPARK_APP_PRIVATE_KEY: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }}
There was a problem hiding this comment.
Done in c9be512 — replaced secrets: inherit with explicit pass-through of ECOSPARK_APP_ID and ECOSPARK_APP_PRIVATE_KEY.
Agent-Logs-Url: https://github.com/sanity-io/plugins/sessions/e7058519-5208-4f1c-a030-e96643008749 Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>
|
@copilot knip check is failing due to zizmor, configure knip so it ignores zizmor |
Agent-Logs-Url: https://github.com/sanity-io/plugins/sessions/a6265b40-5aa1-4c03-85f6-e77e5699ba25 Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Hardens GitHub Actions workflows against expression injection and over-privileged tokens by moving untrusted inputs into env vars, scoping actions/create-github-app-token permissions, and replacing secrets: inherit with explicit secret passthrough. Adds a new zizmor audit workflow plus a lint:workflows script for local runs.
Changes:
- New
zizmor.ymlconfig and.github/workflows/zizmor.ymlworkflow (pinned action, empty top-level permissions,persist-credentials: false). - Across many workflows: replace
${{ ... }}interpolation inrun:blocks with environment-variable indirection; scope app-token permissions tocontents: writeandpull-requests: write; addpermissions: contents: readtodeploy-test-studio.yml. changesets-from-conventional-commits.yml: replacesecrets: inheritwith explicit secrets and add azizmor: ignoreannotation justifyingpull_request_target.package.jsonaddslint:workflowsscript;knip.jsoncaddszizmortoignoreBinaries.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| zizmor.yml | New zizmor rules config restricting unpinned uses by owner. |
| .github/workflows/zizmor.yml | New audit workflow running zizmor at high severity. |
| .github/workflows/ci.yml | Move github.base_ref into env to avoid expression injection in run. |
| .github/workflows/pkg-pr-new.yml | Same env-indirection treatment for base_ref and computed package_paths. |
| .github/workflows/deploy-test-studio.yml | Add minimal contents: read permissions block. |
| .github/workflows/setup-trusted-publish.yml | Move inputs.package into env for shell steps. |
| .github/workflows/lint-fix-if-needed.yml | Scope app-token perms; env-indirect PR number for gh pr merge. |
| .github/workflows/pnpm-if-needed.yml | Same scoping/env-indirection pattern. |
| .github/workflows/typegen.yml | Same scoping/env-indirection pattern. |
| .github/workflows/update-skills-if-needed.yml | Same scoping/env-indirection pattern. |
| .github/workflows/renovate.yml | Scope app-token permissions. |
| .github/workflows/changesets-from-conventional-commits.yml | Annotate pull_request_target; pass secrets explicitly. |
| package.json | Add lint:workflows script invoking zizmor if installed. |
| knip.jsonc | Whitelist external zizmor binary. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| on: | ||
| pull_request_target: | ||
| pull_request_target: # zizmor: ignore[dangerous-triggers] gated to renovate[bot]/squiggler-app[bot]; no PR code is checked out or executed in the reusable workflow |
There was a problem hiding this comment.
I'm not familiar enough with the existing setup to verify the validity of this
secrets: inheritwith explicit secrets in changesets workflow