Skip to content

ci(workflow): Add zizmor linter and harden GitHub Actions security#1212

Merged
yamadashy merged 2 commits intomainfrom
ci/add-zizmor-workflow-linter
Mar 7, 2026
Merged

ci(workflow): Add zizmor linter and harden GitHub Actions security#1212
yamadashy merged 2 commits intomainfrom
ci/add-zizmor-workflow-linter

Conversation

@yamadashy
Copy link
Owner

@yamadashy yamadashy commented Mar 7, 2026

Add actionlint + zizmor security linters to CI and fix all findings across workflows.

Changes

New CI jobs

  • Add lint-zizmor job using zizmorcore/zizmor-action@v0.5.0 (SHA-pinned)
  • Rename lint-actionlint-actionlint for clarity

Security hardening (zizmor findings)

  • Add persist-credentials: false to all actions/checkout steps across 14 workflows
  • Fix template injection in .github/actions/repomix/action.yml by converting ${{ inputs.* }} to environment variables
  • Pin Homebrew/actions/*@main to SHA 50b8c2ab to prevent tag-rewriting supply chain attacks
  • Add .github/zizmor.yml config to ignore artipacked for schema-update.yml (needs credentials for git-auto-commit-action push)

Checklist

  • Run npm run test
  • Run npm run lint

🤖 Generated with Claude Code


Open with Devin

yamadashy and others added 2 commits March 7, 2026 20:38
- Rename lint-action to lint-actionlint for consistency
- Add lint-zizmor job using zizmorcore/zizmor-action (SHA-pinned)
- Add timeout-minutes to both jobs
- zizmor provides security-focused static analysis for GitHub Actions
  workflows, detecting issues like pull_request_target misuse,
  expression injection, and overly permissive permissions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix all findings from actionlint and zizmor security linters:
- Add persist-credentials: false to all checkout steps across 14 workflows
- Fix template injection in repomix action by using env vars instead of ${{ inputs.* }}
- Pin Homebrew actions to SHA (50b8c2ab) instead of @main tag
- Add zizmor config to ignore artipacked for schema-update.yml (needs credentials for push)
- Add zizmor linter job and config path to ci.yml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link

Deploying repomix with  Cloudflare Pages  Cloudflare Pages

Latest commit: ba16033
Status: ✅  Deploy successful!
Preview URL: https://675d8689.repomix.pages.dev
Branch Preview URL: https://ci-add-zizmor-workflow-linte.repomix.pages.dev

View logs

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the project's CI/CD security posture by integrating a new security linter, zizmor, and addressing several identified vulnerabilities. It focuses on hardening GitHub Actions workflows against common security risks, such as template injection and supply chain attacks, while also improving the clarity of existing linting jobs. The changes ensure a more secure and robust automated testing and deployment environment.

Highlights

  • New CI Linter Integration: Integrated the zizmor security linter into the CI pipeline and renamed the existing lint-action job to lint-actionlint for improved clarity.
  • GitHub Actions Security Hardening: Applied persist-credentials: false to all actions/checkout steps across 14 workflows to enhance security by preventing credential leakage.
  • Template Injection Vulnerability Fix: Resolved a template injection vulnerability in .github/actions/repomix/action.yml by converting direct input variable usage to environment variables within shell commands.
  • Supply Chain Security Enhancement: Pinned Homebrew/actions/*@main to a specific SHA (50b8c2ab) to mitigate risks associated with tag-rewriting supply chain attacks.
  • Zizmor Linter Configuration: Added a .github/zizmor.yml configuration file to ignore the artipacked rule for schema-update.yml, accommodating its need for credentials during git-auto-commit-action pushes.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .github/actions/repomix/action.yml
    • Converted direct GitHub Actions inputs.* variables to environment variables for shell commands to prevent template injection.
  • .github/zizmor.yml
    • Added a new zizmor configuration file.
    • Configured zizmor to ignore the artipacked rule for the schema-update.yml workflow.
Ignored Files
  • Ignored by pattern: .github/workflows/** (13)
    • .github/workflows/autofix.yml
    • .github/workflows/benchmark.yml
    • .github/workflows/ci.yml
    • .github/workflows/claude-code-review.yml
    • .github/workflows/claude-issue-similar.yml
    • .github/workflows/claude-issue-triage.yml
    • .github/workflows/claude.yml
    • .github/workflows/codeql.yml
    • .github/workflows/docker.yml
    • .github/workflows/homebrew.yml
    • .github/workflows/npm-publish.yml
    • .github/workflows/pack-repository.yml
    • .github/workflows/test-action.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a6d2b80e-f61a-42ce-a36b-255d16faa20e

📥 Commits

Reviewing files that changed from the base of the PR and between 8fea965 and ba16033.

📒 Files selected for processing (15)
  • .github/actions/repomix/action.yml
  • .github/workflows/autofix.yml
  • .github/workflows/benchmark.yml
  • .github/workflows/ci.yml
  • .github/workflows/claude-code-review.yml
  • .github/workflows/claude-issue-similar.yml
  • .github/workflows/claude-issue-triage.yml
  • .github/workflows/claude.yml
  • .github/workflows/codeql.yml
  • .github/workflows/docker.yml
  • .github/workflows/homebrew.yml
  • .github/workflows/npm-publish.yml
  • .github/workflows/pack-repository.yml
  • .github/workflows/test-action.yml
  • .github/zizmor.yml

📝 Walkthrough

Walkthrough

This PR implements security-focused credential handling improvements across multiple GitHub Actions workflows by disabling credential persistence, introduces a new zizmor linting job in the CI workflow, refactors the repomix action to use environment variables for input substitution, pins Homebrew workflow actions to a specific commit, and adds a configuration rule to exclude schema-update.yml from zizmor processing.

Changes

Cohort / File(s) Summary
Repomix Action Enhancement
.github/actions/repomix/action.yml
Refactors input handling to expose input values as environment variables (REPOMIX_VERSION, INPUT_DIRECTORIES, etc.) and updates the script to consume those variables instead of direct GitHub Actions expressions. Updates npm install to quote the version reference.
Checkout Security Hardening
.github/workflows/autofix.yml, .github/workflows/benchmark.yml, .github/workflows/claude-*.yml, .github/workflows/codeql.yml, .github/workflows/docker.yml, .github/workflows/npm-publish.yml, .github/workflows/pack-repository.yml, .github/workflows/test-action.yml
Adds persist-credentials: false to actions/checkout steps across all specified workflows, disabling credential persistence during repository checkout for enhanced security.
CI Workflow and Linting Updates
.github/workflows/ci.yml
Adds persist-credentials: false to checkout steps, introduces new lint-zizmor job for advanced security linting, and renames existing lint-action job to lint-actionlint with updated timeout configuration.
Homebrew Action Pinning
.github/workflows/homebrew.yml
Pins three Homebrew-related actions (setup-homebrew, git-user-config, bump-packages) to a specific commit hash (50b8c2ab4a835c38897ed2c56c293b07167c0b59) instead of using the main tag.
Zizmor Configuration
.github/zizmor.yml
Adds a new ignore rule under the artipacked section to exclude schema-update.yml from processing, with a comment noting that git-auto-commit-action requires persist-credentials for pushing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: adding zizmor linter and hardening GitHub Actions security through persist-credentials and other security measures.
Description check ✅ Passed The description includes well-organized sections covering new CI jobs, security hardening changes, and completed checklist items. All required sections are present and comprehensive.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci/add-zizmor-workflow-linter

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Mar 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.14%. Comparing base (816d414) to head (ba16033).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1212   +/-   ##
=======================================
  Coverage   87.14%   87.14%           
=======================================
  Files         115      115           
  Lines        4310     4310           
  Branches      998      998           
=======================================
  Hits         3756     3756           
  Misses        554      554           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively hardens the GitHub Actions workflows by introducing security linters and addressing their findings, such as preventing template injection in repomix/action.yml by using environment variables. The changes are well-aligned with security best practices. I've added a couple of suggestions to further improve the robustness of the repomix action by addressing fragile argument parsing, which can lead to incorrect behavior when inputs contain spaces.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@yamadashy yamadashy merged commit 6c42bf2 into main Mar 7, 2026
63 of 65 checks passed
@yamadashy yamadashy deleted the ci/add-zizmor-workflow-linter branch March 7, 2026 12:18
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.

1 participant