Harden workflow security#20054
Conversation
Confidence Score: 4/5The changes are safe to merge with one oversight: the integration-tests workflow's All four workflow files received the Cargo cache fix and most received .github/workflows/integration-tests.yml — the Reviews (3): Last reviewed commit: "do not cache `~/.cargo/bin/`" | Re-trigger Greptile |
5873e96 to
4bbee19
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
WalkthroughThis PR updates GitHub Actions workflows: it removes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/prepare-release.yml (1)
206-206: ⚡ Quick winRemove
|| trueto ensure--frozen-lockfilefailures are not masked.The
|| truesuppresses install failures, defeating the determinism protection provided by--frozen-lockfile. Either the installation should succeed or the step should fail.Suggested fix
- pnpm install --ignore-scripts --frozen-lockfile --filter=!./playgrounds/* || true + pnpm install --ignore-scripts --frozen-lockfile --filter=!./playgrounds/*🤖 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/workflows/prepare-release.yml at line 206, The workflow step currently runs "pnpm install --ignore-scripts --frozen-lockfile --filter=!./playgrounds/* || true", which masks failures; remove the trailing "|| true" so that failures from --frozen-lockfile cause the job to fail. Update the step in prepare-release.yml to run the pnpm install command without the "|| true" suffix and keep the existing flags (--ignore-scripts, --frozen-lockfile, --filter=!./playgrounds/*) intact.
🤖 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.
Nitpick comments:
In @.github/workflows/prepare-release.yml:
- Line 206: The workflow step currently runs "pnpm install --ignore-scripts
--frozen-lockfile --filter=!./playgrounds/* || true", which masks failures;
remove the trailing "|| true" so that failures from --frozen-lockfile cause the
job to fail. Update the step in prepare-release.yml to run the pnpm install
command without the "|| true" suffix and keep the existing flags
(--ignore-scripts, --frozen-lockfile, --filter=!./playgrounds/*) intact.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: a91c6423-f33d-4778-acff-1f47ff6a52ab
📒 Files selected for processing (4)
.github/workflows/ci.yml.github/workflows/integration-tests.yml.github/workflows/prepare-release.yml.github/workflows/release.yml
💤 Files with no reviewable changes (1)
- .github/workflows/integration-tests.yml
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/ci.yml:
- Around line 89-90: Update the "Install dependencies" CI step so the pnpm
install command also passes --ignore-scripts: locate the step with name "Install
dependencies" that currently runs "pnpm install --frozen-lockfile" and append
"--ignore-scripts" to that run command to align with other workflows and enforce
supply-chain hardening.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 6f685cac-4983-4201-9e33-aebf1a8f0f2b
📒 Files selected for processing (4)
.github/workflows/ci.yml.github/workflows/integration-tests.yml.github/workflows/prepare-release.yml.github/workflows/release.yml
💤 Files with no reviewable changes (1)
- .github/workflows/integration-tests.yml
🚧 Files skipped from review as they are similar to previous changes (2)
- .github/workflows/prepare-release.yml
- .github/workflows/release.yml
| - name: Install dependencies | ||
| run: pnpm install | ||
| run: pnpm install --frozen-lockfile |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify all workflow pnpm install commands enforce both flags.
# Expected: no output from the two "missing flag" checks.
echo "All pnpm install lines:"
rg -nP --iglob '*.yml' '^\s*run:\s*pnpm\s+install\b' .github/workflows
echo
echo "Install lines missing --ignore-scripts (should be empty):"
rg -nP --iglob '*.yml' '^\s*run:\s*pnpm\s+install\b(?!.*--ignore-scripts)' .github/workflows
echo
echo "Install lines missing --frozen-lockfile (should be empty):"
rg -nP --iglob '*.yml' '^\s*run:\s*pnpm\s+install\b(?!.*--frozen-lockfile)' .github/workflowsRepository: tailwindlabs/tailwindcss
Length of output: 815
Add --ignore-scripts to complete the workflow hardening goal.
Line 90 allows lifecycle scripts during install, which weakens the supply-chain hardening intent. Other workflows (release.yml, prepare-release.yml) correctly enforce both --frozen-lockfile and --ignore-scripts.
Suggested patch
- - name: Install dependencies
- run: pnpm install --frozen-lockfile
+ - name: Install dependencies
+ run: pnpm install --frozen-lockfile --ignore-scripts📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Install dependencies | |
| run: pnpm install | |
| run: pnpm install --frozen-lockfile | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --ignore-scripts |
🤖 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/workflows/ci.yml around lines 89 - 90, Update the "Install
dependencies" CI step so the pnpm install command also passes --ignore-scripts:
locate the step with name "Install dependencies" that currently runs "pnpm
install --frozen-lockfile" and append "--ignore-scripts" to that run command to
align with other workflows and enforce supply-chain hardening.
There was a problem hiding this comment.
This results in issues with bun that require it. Will need to figure out another solution here instead.
There was a problem hiding this comment.
@RobinMalfait, understood — thanks for the context. Withdrawing the suggestion; --ignore-scripts is not viable here because bun's install lifecycle scripts are required for the setup to work correctly. The --frozen-lockfile flag alone is a meaningful improvement for lockfile consistency, and a targeted approach (e.g., selectively blocking specific packages via .npmrc/.pnpmfile.cjs hooks, or pinning the bun package version and auditing its scripts separately) may be worth exploring as a follow-up if stronger supply-chain hardening is still desired.
✏️ Learnings added
Learnt from: RobinMalfait
Repo: tailwindlabs/tailwindcss PR: 20054
File: .github/workflows/ci.yml:89-90
Timestamp: 2026-05-14T10:42:57.173Z
Learning: In the tailwindlabs/tailwindcss repository, `pnpm install --ignore-scripts` cannot be used in GitHub Actions workflows because bun requires lifecycle scripts to run during installation. Adding `--ignore-scripts` breaks the bun-related setup. Only `--frozen-lockfile` is safe to enforce across CI/release workflows here.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
- No need to be able to mint an ID-token during the prepare release worfklow - No need for write permissions during the relase, we're not _creating_ a GitHub release in this case
4bbee19 to
3fa9a00
Compare
This PR improves the workflows a bit more by:
pnpm installwith a frozen lockfile~/.cargo/bin/Test plan
[ci-all]