Skip to content

Commit 0bb6dbd

Browse files
jdxclaude
andauthored
ci: require zizmor in final (#1535)
<!-- entire-trail-link-start --> https://entire.io/gh/jdx/usage/trails/80 <!-- entire-trail-link-end --> zizmor ran as its own workflow (\`zizmor.yml\`), so the \`final\` check that branch protection requires never saw it. A zizmor failure could not block merging. This moves the zizmor job into \`test.yml\` and makes \`final\` depend on it: - Adds a \`zizmor\` job to \`test.yml\` with the same steps, pinned SHAs and \`advanced-security: false\` as before, and \`contents: read\` permissions. - Adds \`zizmor\` to \`final\`'s \`needs\`. \`final\` now fails unless \`needs.zizmor.result == success\`, so a failed, cancelled or skipped zizmor run blocks the merge. - Deletes \`zizmor.yml\`. Behavior change: zizmor previously ran only on pushes to main and on PRs touching \`.github/workflows/**\`. It now runs on every PR and push, because a path-filtered job would be skipped and a skipped job would fail \`final\`. It is a short job. Not validated locally beyond reading the diff: no YAML parser, actionlint or zizmor was usable here. CI on this PR is the validation. Mirrors jdx/hk#1679. 🤖 Generated with [Claude Code](https://claude.com/claude-code) *AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: unavailable.* <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > CI workflow wiring only; no runtime or application code changes. > > **Overview** > **Moves the zizmor workflow security scan into `test.yml` so branch protection’s `final` check can block merges when it fails.** > > The standalone `.github/workflows/zizmor.yml` is removed and replaced with a `zizmor` job in `test.yml` (same pinned actions and `advanced-security: false`). `final` now lists `zizmor` in `needs` and exits non-zero unless `needs.zizmor.result` is `success`, so failed, cancelled, or skipped zizmor runs fail the required check. > > **Behavior change:** zizmor previously ran only on `main` pushes and PRs touching `.github/workflows/**`; it now runs on every `test` workflow trigger so a path-filtered skip would not fail `final`. > > Also updates a version comment on `apple-actions/import-codesign-certs` in `publish-cli.yml` (`# v7` → `# v7.0.0`). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit fcc1959. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * The test workflow now runs an additional security scan, and the final check requires that scan to succeed. * The separate workflow that ran security scans on pushes to the main branch and qualifying pull requests has been removed. Security scanning is now part of the test workflow instead. * No changes to app functionality are included. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent b3f7f5e commit 0bb6dbd

3 files changed

Lines changed: 21 additions & 24 deletions

File tree

‎.github/workflows/publish-cli.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
experimental: true
105105
cache: false
106106
- if: matrix.os == 'macos-latest'
107-
uses: apple-actions/import-codesign-certs@5142e029c445c10ffc7149d172e540235a065466 # v7
107+
uses: apple-actions/import-codesign-certs@5142e029c445c10ffc7149d172e540235a065466 # v7.0.0
108108
with:
109109
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERTS_P12 }}
110110
p12-password: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERTS_P12_PASS }}

‎.github/workflows/test.yml‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,38 @@ jobs:
2424
with:
2525
trusted: false
2626

27+
zizmor:
28+
name: zizmor
29+
runs-on: ubuntu-latest
30+
timeout-minutes: 10
31+
permissions:
32+
contents: read
33+
steps:
34+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
35+
with:
36+
persist-credentials: false
37+
- uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4
38+
with:
39+
advanced-security: false
40+
2741
final:
2842
name: final
2943
if: ${{ always() && !cancelled() && needs.trusted.result != 'cancelled' && needs.untrusted.result != 'cancelled' }}
3044
permissions: {}
31-
needs: [trusted, untrusted]
45+
needs: [trusted, untrusted, zizmor]
3246
runs-on: ubuntu-latest
3347
timeout-minutes: 1
3448
steps:
3549
- name: Check selected workflow result
3650
env:
3751
TRUSTED_RESULT: ${{ needs.trusted.result }}
3852
UNTRUSTED_RESULT: ${{ needs.untrusted.result }}
53+
ZIZMOR_RESULT: ${{ needs.zizmor.result }}
3954
run: |
55+
if [[ "$ZIZMOR_RESULT" != success ]]; then
56+
echo "zizmor=$ZIZMOR_RESULT"
57+
exit 1
58+
fi
4059
if [[ "$TRUSTED_RESULT" == success && "$UNTRUSTED_RESULT" == skipped ]] ||
4160
[[ "$TRUSTED_RESULT" == skipped && "$UNTRUSTED_RESULT" == success ]]; then
4261
exit 0

‎.github/workflows/zizmor.yml‎

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)