Skip to content

ci: Integrate zizmor checks to repo #818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Jun 5, 2025
Merged

Conversation

MaxymVlasov
Copy link
Collaborator

That PR integrate one more static analysis tool, as CodeQL is good, but it not cover all cases
Here is an article about zizmor value - https://blog.yossarian.net/2024/12/06/zizmor-ultralytics-injection
zizmor repo - https://github.com/woodruffw/zizmor

Copy link

coderabbitai bot commented Feb 14, 2025

Warning

Rate limit exceeded

@MaxymVlasov has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 30 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between dea6ba1 and d8a7602.

📒 Files selected for processing (3)
  • .github/workflows/ci-cd.yml (10 hunks)
  • .github/workflows/pre-commit.yaml (2 hunks)
  • .github/workflows/reusable-tox.yml (6 hunks)
📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Updated multiple GitHub Actions workflows to disable persistence of GitHub token credentials during code checkout for improved security.
    • Refined environment variable usage and shell scripting in workflows for clarity and compatibility.
    • Adjusted scheduled workflow to explicitly pass required secrets instead of inheriting all.
    • Changed PR title validation workflow trigger for enhanced security context.
    • Added new static analysis tool to pre-commit checks.

Summary by CodeRabbit

  • Chores
    • Added a new static analysis tool to the pre-commit configuration to enhance code quality checks.
  • Infrastructure
    • Updated multiple GitHub Actions workflows to disable persistence of GitHub token credentials during repository checkout by setting persist-credentials: false.
    • Refined environment variable usage and shell commands in workflows for improved clarity and consistency.
  • Workflow Trigger
    • Changed the PR title validation workflow trigger event from pull_request_target to pull_request.

Walkthrough

The pull request adds a new repository entry for the zizmor static analysis tool in .pre-commit-config.yaml. It also updates several GitHub Actions workflows to set persist-credentials: false on actions/checkout steps, disabling automatic persistence of GitHub token credentials during checkout. Additionally, the PR title workflow trigger event was changed from pull_request_target to pull_request, and some workflows were refined for clarity and consistency in environment variable usage.

Changes

File(s) Change Summary
.pre-commit-config.yaml Added new repository entry for the zizmor static analysis tool from woodruffw/zizmor-pre-commit at v1.9.0
.github/workflows/build-image-test.yaml, .github/workflows/build-image.yaml, Updated actions/checkout steps to include persist-credentials: false to disable token persistence
.github/workflows/ci-cd.yml, .github/workflows/codeql.yml, .github/workflows/dependency-review.yml, .github/workflows/pre-commit.yaml, .github/workflows/reusable-tox.yml
.github/workflows/pr-title.yml Changed workflow trigger event from pull_request_target to pull_request
.github/workflows/scheduled-runs.yml Modified secrets passing to explicitly provide only CODECOV_TOKEN instead of inheriting all secrets

Suggested reviewers

  • yermulnik
  • antonbabenko

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1e54f11 and 9bd1771.

📒 Files selected for processing (1)
  • .pre-commit-config.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: 🧪 Tests / pytest@🐍3.9@windows-2025
  • GitHub Check: 🧪 Tests / pytest@🐍3.12@windows-2025
  • GitHub Check: 🧪 Tests / pytest@🐍3.11@windows-2025
  • GitHub Check: 🧪 Tests / pytest@🐍3.12@macos-13
  • GitHub Check: 🧪 Tests / pytest@🐍3.11@macos-13
  • GitHub Check: 🧪 Tests / pytest@🐍3.10@windows-2025
  • GitHub Check: 🧪 Tests / pytest@🐍3.10@macos-13
  • GitHub Check: 🧹 Linters / pre-commit@🐍3.13@ubuntu-latest
  • GitHub Check: pre-commit
🔇 Additional comments (1)
.pre-commit-config.yaml (1)

68-72: LGTM! Good addition to the security tooling.

The integration of Zizmor as a pre-commit hook complements the existing security checks (gitleaks, detect-aws-credentials, detect-private-key) and provides additional coverage alongside CodeQL, specifically for GitHub Actions analysis.

@MaxymVlasov
Copy link
Collaborator Author

MaxymVlasov commented Feb 14, 2025

Oh, I see, there a bunch of issues in workflows needed to be fixed first

@MaxymVlasov MaxymVlasov marked this pull request as draft February 14, 2025 05:37
yermulnik
yermulnik previously approved these changes Feb 14, 2025
Copy link
Collaborator

@yermulnik yermulnik left a comment

Choose a reason for hiding this comment

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

Hope at some point we won't end up running several dozens of GH actions over the handful of scripts that we maintain here 🤣

This comment was marked as resolved.

@github-actions github-actions bot added stale Denotes an issue or PR has remained open with no activity and has become stale. and removed stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 17, 2025
@MaxymVlasov MaxymVlasov added the on-hold Indicates that an issue or PR should not be auto-closed due to staleness. label Mar 20, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.pre-commit-config.yaml (1)

50-55: Verify Zizmor hook version and streamline its scope

  • Ensure that rev: v1.9.0 is the intended stable release and free of known security or compatibility issues by checking the GitHub Releases page or querying the API.
  • (Optional) Restrict the hook to only run on GitHub Actions workflow files to improve performance and reduce noise:
    - id: zizmor
      files: '^\.github/workflows/.*\.(ya?ml)$'
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 79085a6 and c23c9db.

📒 Files selected for processing (1)
  • .pre-commit-config.yaml (1 hunks)

@MaxymVlasov MaxymVlasov removed the on-hold Indicates that an issue or PR should not be auto-closed due to staleness. label Jun 1, 2025
@MaxymVlasov MaxymVlasov force-pushed the MaxymVlasov-patch-2 branch from c087300 to e50d2e0 Compare June 2, 2025 18:52
@MaxymVlasov MaxymVlasov force-pushed the MaxymVlasov-patch-2 branch from 2192c00 to dea6ba1 Compare June 2, 2025 19:18
@MaxymVlasov MaxymVlasov marked this pull request as ready for review June 2, 2025 21:12
@MaxymVlasov MaxymVlasov requested a review from antonbabenko as a code owner June 2, 2025 21:12
@MaxymVlasov MaxymVlasov requested a review from yermulnik June 2, 2025 21:12
yermulnik
yermulnik previously approved these changes Jun 2, 2025
Copy link
Collaborator

@yermulnik yermulnik left a comment

Choose a reason for hiding this comment

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

Approved as technically there seem to be no issues.
Please consider comments and commit suggestions as you think they worth it.

@@ -47,6 +47,12 @@ repos:
hooks:
- id: gitleaks

# Github Action static analysis tool
- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v1.9.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Tag and not commit hash? I thought you tend to trust commits rather than tags 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need to switch out from Renovate to pre-commit-freeze then.

I'll do it as separate PR

Co-authored-by: George L. Yermulnik <[email protected]>
MaxymVlasov and others added 2 commits June 5, 2025 20:40
Co-authored-by: George L. Yermulnik <[email protected]>
Co-authored-by: George L. Yermulnik <[email protected]>
@MaxymVlasov MaxymVlasov requested a review from yermulnik June 5, 2025 17:45
https://github.com/antonbabenko/pre-commit-terraform/actions/runs/15473791768

 Invalid workflow file: .github/workflows/scheduled-runs.yml#L41
The workflow is not valid. .github/workflows/scheduled-runs.yml (Line: 41, Col: 22): Invalid secret, CODECOV_TOKEN is not defined in the referenced workflow.
Copy link
Collaborator

@yermulnik yermulnik left a comment

Choose a reason for hiding this comment

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

A mug of weird black magic for me 🤣 Overall looks good to me in those bits that I was able to understand =)))

@MaxymVlasov
Copy link
Collaborator Author

MaxymVlasov commented Jun 5, 2025

GitHub failed to run workflows or what -_-

Ah, I see
image

@MaxymVlasov MaxymVlasov closed this Jun 5, 2025
@MaxymVlasov MaxymVlasov reopened this Jun 5, 2025
@MaxymVlasov MaxymVlasov enabled auto-merge (squash) June 5, 2025 21:17
@MaxymVlasov MaxymVlasov disabled auto-merge June 5, 2025 21:20
@MaxymVlasov MaxymVlasov enabled auto-merge (squash) June 5, 2025 21:22
@MaxymVlasov MaxymVlasov disabled auto-merge June 5, 2025 21:45
@MaxymVlasov MaxymVlasov closed this Jun 5, 2025
@MaxymVlasov MaxymVlasov reopened this Jun 5, 2025
@MaxymVlasov MaxymVlasov merged commit 7f976b5 into master Jun 5, 2025
175 of 192 checks passed
@MaxymVlasov MaxymVlasov deleted the MaxymVlasov-patch-2 branch June 5, 2025 22:02
@antonbabenko
Copy link
Owner

This PR is included in version 1.99.2 🎉

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.

3 participants