Skip to content

Zizmor - #1886

Merged
benalleng merged 4 commits into
payjoin:masterfrom
benalleng:zizmor
Oct 17, 2026
Merged

Zizmor#1886
benalleng merged 4 commits into
payjoin:masterfrom
benalleng:zizmor

Conversation

@benalleng

@benalleng benalleng commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

This PR introduces the zizmor CI hardening

I know there are a lot of file changes here but ultimately we just want consistency in the first commit.

Closes #1840

Coded with Big Pickle

Pull Request Checklist

Please confirm the following before requesting review:

@coveralls

coveralls commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 38962872602

Coverage remained the same at 87.475%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 17860
Covered Lines: 15623
Line Coverage: 87.47%
Coverage Strength: 319.44 hits per line

💛 - Coveralls

@benalleng

Copy link
Copy Markdown
Collaborator Author

@chavic I think you would be best to take a look here just because I think you might be interested in this.

@caarloshenriq caarloshenriq left a comment

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.

Concept ACK

Hardening looks right (zizmor offline 362 → 0 locally). One real bug:

smoke-npm is broken. Replayed the run block against a locally-built tarball:

ERR_MODULE_NOT_FOUND: Cannot find package '@ubjs/core'
imported from dist/nodejs/generated/payjoin.js

The tar -x unpacks only the package's dist and never installs the runtime dep @ubjs/core. Doesn't show here because javascript.yml doesn't trigger on .github-only PRs, but publish-npm needs smoke-npm, so it'll block the next payjoin-ffi PR and JS release. npm install --ignore-scripts ../pkg/payjoin-*.tgz keeps deps resolving.

spacebear21
spacebear21 previously approved these changes Oct 9, 2026

@spacebear21 spacebear21 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

cACK

Regarding the broken smoke-npm job, I wonder if we can/should add triggers on .github files? Feels like any change to how a job runs should at least be checked in the PR changing it.

@benalleng

benalleng commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator Author

I added a commit that adds on self file change run the job. I didn't apply it to workflow_call jobs or ones that made PRs as I don't think that makes sense as they often use manual triggers for testing.

Edit: squashed it into the prepare commit

@benalleng
benalleng force-pushed the zizmor branch 3 times, most recently from ecf2491 to c1ddd44 Compare October 9, 2026 20:00
@benalleng
benalleng requested a review from spacebear21 October 9, 2026 20:00
spacebear21
spacebear21 previously approved these changes Oct 9, 2026

@spacebear21 spacebear21 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utACK

@caarloshenriq caarloshenriq left a comment

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.

tACK

@DanGould DanGould left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Pinning commit hashes turns off Dependabot alerts for these actions (GitHub only alerts on semver refs like @v4, not hashes), so we would add a .github/dependabot.yml for the github-actions ecosystem to keep the pins current, otherwise this is a regression

Comment thread .github/workflows/crates-release.yml
@DanGould

Copy link
Copy Markdown
Member

Also wondering if dropping GH_TOKEN from the zizmor template was intentional? because there's no rationale included. Without it zizmor runs offline and skips ref-version-mismatch, impostor-commit and known-vulnerable-actions

@benalleng

Copy link
Copy Markdown
Collaborator Author

Also wondering if dropping GH_TOKEN from the zizmor template was intentional?

Ahh yes, I did not use the template straight from the zizmor documentation I can add that

@benalleng

benalleng commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator Author

I added an additional update-actions-pin cron job to hopefully bump pins for workflows where the dependabot will fail as dependabot does not understand how to bump branches like dtolnay/rust-toolchain@1.85.0, it can only bump release tags.

@benalleng
benalleng force-pushed the zizmor branch 3 times, most recently from da804d8 to 704964d Compare October 15, 2026 17:50

@DanGould DanGould left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some ~sane sounding bot feedback + the conversation we had offline. Almost there ..

Thanks for sticking with this. Let's drop the last commit as discussed out of band. To push edits to workflow files, the pin bump job needs a token with the workflows permission, and a token like that can run arbitrary code in CI. That's a lot of trust for about five pins. The rust-toolchain pins only freeze the action's wrapper, since the toolchain is still picked when the job runs, so a manual bump now and then is fine. That leaves a few things:

  • The nightly toolchain job edits rust.yml, and with the token limited to contents and pull requests (nightly-maintenance.yml#L47-L48) its push will be rejected. Please add permission-workflows: write there. Master's token gets that permission implicitly.
  • Dependabot only reads .github/workflows with directory: / (dependabot.yml#L17), so the pins in .github/actions/setup-nix won't get bumped. directories: ["/", "/.github/actions/*"] covers both. While you're in there, could you pin determinate-nix-action to v3.23.2 instead of main so dependabot can track it?
  • The uv entry points at the root (dependabot.yml#L6), but uv.lock is in payjoin-ffi/python.
  • Optional: the test-* jobs in flake-maintenance (#L64-L86) run against master's flake.lock, not the updated one. The PR that update-flake-lock opens already runs those workflows, so I think they can go.

It also needs a rebase. The only conflict is in crates-release.yml.

Comment thread .github/dependabot.yml Outdated
@benalleng
benalleng force-pushed the zizmor branch 5 times, most recently from 1a09cc2 to 9b4f547 Compare October 16, 2026 17:00
@benalleng
benalleng requested a review from DanGould October 16, 2026 17:23
spacebear21
spacebear21 previously approved these changes Oct 16, 2026

@spacebear21 spacebear21 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ACK 9b4f547

Add on own edit checks for workflows that may have impacts on PR success

Fix smoke to allow CI to pass

This also adds a specific lockfile `smoke/package.json` so the CI job
does not install anything ad-hoc which would violate the zizmor checks.
Following the zizmor hash pinning we need a dependabot job to update our
workflow action checks to keep things current.

@spacebear21 spacebear21 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

reACK

@benalleng
benalleng merged commit 94cfdce into payjoin:master Oct 17, 2026
57 checks passed
@benalleng benalleng mentioned this pull request Oct 17, 2026
3 tasks done
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.

Explore zizmore CI hardening

6 participants