Skip to content

Fix CI pipeline security issues reported by zizmor - #1242

Merged
Strift merged 2 commits into
meilisearch:mainfrom
DhavalGojiya:security/zizmor
Jun 15, 2026
Merged

Fix CI pipeline security issues reported by zizmor#1242
Strift merged 2 commits into
meilisearch:mainfrom
DhavalGojiya:security/zizmor

Conversation

@DhavalGojiya

@DhavalGojiya DhavalGojiya commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes all CI pipeline security issues reported by zizmor

% uvx zizmor .

meilli

PR checklist

Please check if your PR fulfills the following requirements:

  • Did you use any AI tool while implementing this PR (code, tests, docs, etc.)? If yes, disclose it in the PR description and describe what it was used for. AI usage is allowed when it is disclosed.
  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

Summary

This PR addresses CI pipeline security issues identified by the Zizmor security audit tool. It hardens GitHub Actions workflows and related configuration by tightening GitHub token permissions, pinning third-party action references to commit SHAs, and reducing credential exposure in workflow runs.

Changes

Workflow Security Hardening

Permission scoping (least privilege):

  • Added or tightened explicit permissions blocks to restrict token access, including:
    • documentation.yml, tests.yml, pypi-publish.yml, update-version.yml: top-level contents: read
    • documentation.yml: job-level permissions for Pages deployment
    • release-drafter.yml: job-level contents: write and pull-requests: write
    • pre-release-tests.yml: job-level contents: read

Action pinning (remove tag-based references):

  • Updated multiple workflows to pin GitHub Actions (e.g., actions/checkout, actions/setup-python, astral-sh/setup-uv, and other actions) to specific commit SHAs instead of version tags.

Credential handling:

  • Set persist-credentials: false on actions/checkout steps in the affected workflows to avoid unintended credential/token persistence.

Tooling/version updates:

  • Bumped astral-sh/setup-uv usage to a newer pinned revision and updated the installed uv version to 0.11.21 across applicable workflows.
  • Updated the ibiqlik/action-yamllint action to a pinned revision in tests.yml.
  • Updated EndBug/add-and-commit and release-drafter/release-drafter to pinned revisions in update-version.yml and release-drafter.yml respectively.

Configuration Updates

Dependabot:

  • Updated .github/dependabot.yml to add a cooldown configuration with default-days: 7 for the relevant dependency update entries.

Pre-release tests:

  • Adjusted the Meilisearch RC Docker command to use ${MEILISEARCH_VERSION} (shell environment variable syntax) instead of ${{ env.MEILISEARCH_VERSION }}.

Impact

Overall, these changes reduce CI/CD attack surface by enforcing least-privilege permissions, preventing action supply-chain risks via commit pinning, and limiting token/credential exposure during checkout—directly addressing Zizmor’s GitHub Actions workflow security findings.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9567d4fa-ceb3-4b91-ba11-34de1c0dffb6

📥 Commits

Reviewing files that changed from the base of the PR and between 4d52f15 and a44eb41.

📒 Files selected for processing (1)
  • .github/workflows/update-version.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/update-version.yml

📝 Walkthrough

Walkthrough

This PR hardens CI/CD security across the repository by configuring Dependabot cooldown periods and systematically updating GitHub Actions workflows to add explicit permissions, pin actions to commit SHAs for reproducibility, disable credential persistence, and update tool versions.

Changes

CI/CD Security Hardening and Configuration Updates

Layer / File(s) Summary
Dependabot cooldown configuration
.github/dependabot.yml
Dependency manager now waits 7 days between update pull requests via new cooldown settings.
Workflow permissions, action pinning, and version updates
.github/workflows/documentation.yml, .github/workflows/pre-release-tests.yml, .github/workflows/pypi-publish.yml, .github/workflows/release-drafter.yml, .github/workflows/tests.yml, .github/workflows/update-version.yml
All workflows now declare explicit permissions (read-only at workflow level, with elevated permissions only in specific jobs). All action references are pinned to commit SHAs. Checkout steps set persist-credentials: false. Action versions updated (setup-uv to 0.11.21, yamllint to v3.1.1, release-drafter to v7.3.1). Documentation workflow uses environment variable for Python version instead of hardcoded 3.9. Pre-release tests uses shell syntax for Docker environment variable interpolation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Actions now pinned, like carrots in a row,
Permissions locked tight, security will grow,
Credentials tucked safe, no leaks in the flow,
Workflows strengthened deep, from top down below!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of the pull request—fixing CI pipeline security issues identified by the Zizmor security audit tool across multiple GitHub workflow files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/dependabot.yml (1)

10-11: Consider the security tradeoff of the 7-day cooldown period.

Adding a 7-day cooldown reduces PR noise but may delay critical security patches. If a vulnerability is discovered in a dependency shortly after Dependabot closes or merges a PR, it will wait 7 days before opening a new PR with the security fix. Consider whether the noise reduction justifies this potential delay in applying security updates, or if a shorter cooldown period (e.g., 2-3 days) might provide a better balance.

Also applies to: 22-23

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/dependabot.yml around lines 10 - 11, The Dependabot cooldown is set
to 7 days under the cooldown -> default-days key which may delay critical
security fixes; change the value to a shorter period (e.g., 2 or 3) or document
an exception policy so security PRs are handled faster—update the
cooldown.default-days value from 7 to the chosen smaller number (or add a
comment/policy alongside it) to strike a better balance between noise reduction
and timely vulnerability patches.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/pypi-publish.yml:
- Around line 8-9: Update the workflow permissions and publish step to use OIDC:
add permissions: id-token: write alongside contents: read in the workflow
top-level permissions, and in the "Build and publish" step remove the use of
TWINE_PASSWORD from secrets.PYPI_API_TOKEN and the direct uvx twine@6.2.0
upload; instead switch the publish step to an OIDC-capable publisher (for
example pypa/gh-action-pypi-publish or an equivalent action) that obtains a
short-lived token via the id-token and does not rely on long-lived secrets,
updating references to TWINE_PASSWORD, secrets.PYPI_API_TOKEN and the uvx twine
invocation accordingly.

In @.github/workflows/update-version.yml:
- Around line 15-16: The workflow currently sets permissions: contents: read and
uses actions/checkout with persist-credentials: false, which prevents git push
by EndBug/add-and-commit; change the workflow to grant write access by setting
permissions: contents: write and/or enable persist-credentials: true on
actions/checkout, and ensure EndBug/add-and-commit receives an explicit token
(e.g., pass GH_TOKEN to its token input) so the created branch ${ env.NEW_BRANCH
} can be committed and pushed successfully.

---

Nitpick comments:
In @.github/dependabot.yml:
- Around line 10-11: The Dependabot cooldown is set to 7 days under the cooldown
-> default-days key which may delay critical security fixes; change the value to
a shorter period (e.g., 2 or 3) or document an exception policy so security PRs
are handled faster—update the cooldown.default-days value from 7 to the chosen
smaller number (or add a comment/policy alongside it) to strike a better balance
between noise reduction and timely vulnerability patches.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: db46eec7-c66c-4f56-98f9-b0fc43cc291f

📥 Commits

Reviewing files that changed from the base of the PR and between 218d8eb and 4d52f15.

📒 Files selected for processing (7)
  • .github/dependabot.yml
  • .github/workflows/documentation.yml
  • .github/workflows/pre-release-tests.yml
  • .github/workflows/pypi-publish.yml
  • .github/workflows/release-drafter.yml
  • .github/workflows/tests.yml
  • .github/workflows/update-version.yml

Comment thread .github/workflows/pypi-publish.yml
Comment thread .github/workflows/update-version.yml
@DhavalGojiya

Copy link
Copy Markdown
Contributor Author

Your review plz @Strift

@Strift Strift added the maintenance Anything related to maintenance (CI, tests, refactoring...) label Jun 15, 2026

@Strift Strift 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.

Hey @DhavalGojiya, thanks for the PR!

I love the clean-up and security enhancements 🙌

@Strift
Strift added this pull request to the merge queue Jun 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 15, 2026
@Strift
Strift added this pull request to the merge queue Jun 15, 2026
Merged via the queue into meilisearch:main with commit 22f481d Jun 15, 2026
11 checks passed
@DhavalGojiya
DhavalGojiya deleted the security/zizmor branch June 17, 2026 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Anything related to maintenance (CI, tests, refactoring...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants