Skip to content

ci(workflows): add zizmor audit and harden workflows#885

Open
Copilot wants to merge 4 commits into
mainfrom
copilot/setup-zizmor-as-in-sanity-repo
Open

ci(workflows): add zizmor audit and harden workflows#885
Copilot wants to merge 4 commits into
mainfrom
copilot/setup-zizmor-as-in-sanity-repo

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

  • Add zizmor audit workflow and config
  • Harden expression injection across workflows
  • Scope app token permissions explicitly
  • Add deploy-test-studio permissions
  • Add lint:workflows script
  • Replace secrets: inherit with explicit secrets in changesets workflow
  • Update zizmor ignore annotation text
  • Fix knip check by adding zizmor to ignoreBinaries

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>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 15, 2026

⚠️ No Changeset found

Latest commit: 6bbd399

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
plugins-studio Ready Ready Preview, Comment May 15, 2026 9:03am

Request Review

Copilot AI requested a review from pedrobonamin May 15, 2026 08:36
Copilot stopped work on behalf of pedrobonamin due to an error May 15, 2026 08:36
@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 15, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgithub/​zizmorcore/​zizmor-action@​b1d7e1fb5de872772f31590499237e7cce841e8e8910090100100

View full report

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@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 }}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in c9be512 — replaced secrets: inherit with explicit pass-through of ECOSPARK_APP_ID and ECOSPARK_APP_PRIVATE_KEY.

Comment thread .github/workflows/changesets-from-conventional-commits.yml Outdated
@pedrobonamin
Copy link
Copy Markdown
Contributor

@copilot knip check is failing due to zizmor, configure knip so it ignores zizmor

Run pnpm knip --reporter github-actions

> plugins-monorepo@1.0.0 knip /home/runner/work/plugins/plugins
> knip --reporter github-actions

Unlisted binaries (1)
Error: zizmor in package.json
Unused catalog entries (1)
Warning: @sanity/vision in pnpm-workspace.yaml
 ELIFECYCLE  Command failed with exit code 1.
Error: Process completed with exit code 1.
`

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>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 15, 2026

@copilot knip check is failing due to zizmor, configure knip so it ignores zizmor

...

Fixed in 6bbd399 — added "zizmor" to ignoreBinaries in knip.jsonc root workspace config.

@pedrobonamin pedrobonamin requested a review from bjoerge May 15, 2026 09:26
@pedrobonamin pedrobonamin marked this pull request as ready for review May 15, 2026 09:26
@pedrobonamin pedrobonamin requested a review from a team as a code owner May 15, 2026 09:26
Copilot AI review requested due to automatic review settings May 15, 2026 09:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.yml config and .github/workflows/zizmor.yml workflow (pinned action, empty top-level permissions, persist-credentials: false).
  • Across many workflows: replace ${{ ... }} interpolation in run: blocks with environment-variable indirection; scope app-token permissions to contents: write and pull-requests: write; add permissions: contents: read to deploy-test-studio.yml.
  • changesets-from-conventional-commits.yml: replace secrets: inherit with explicit secrets and add a zizmor: ignore annotation justifying pull_request_target.
  • package.json adds lint:workflows script; knip.jsonc adds zizmor to ignoreBinaries.

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
Copy link
Copy Markdown
Member

@bjoerge bjoerge May 18, 2026

Choose a reason for hiding this comment

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

I'm not familiar enough with the existing setup to verify the validity of this

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.

4 participants