Conversation
WalkthroughA new CI validation step, "Check for unexpected file changes", was added to the workflow and inserted after the unit, acceptance, and legacy test jobs. The step runs 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
394-402: Extract the dirty-worktree check into a shared script to avoid drift.This block is now repeated three times (Line [394], Line [489], Line [579]). Consider centralizing it in one script (e.g.,
.github/scripts/check-clean-worktree.sh) and calling that script from each job.♻️ Suggested refactor
- - name: Check for unexpected file changes - run: | - if [ -n "$(git status --porcelain)" ]; then - echo "Tests generated unexpected file changes. Commit them before merging:" - git status - git diff - exit 1 - fi + - name: Check for unexpected file changes + run: bash .github/scripts/check-clean-worktree.sh#!/usr/bin/env bash set -euo pipefail if [ -n "$(git status --porcelain)" ]; then echo "Tests generated unexpected file changes. Commit them before merging:" git status git diff exit 1 fiAlso applies to: 489-497, 579-587
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/ci.yml around lines 394 - 402, The "Check for unexpected file changes" step is duplicated across multiple CI jobs; extract the logic into a single executable script named check-clean-worktree.sh, add the exact content shown (#!/usr/bin/env bash with set -euo pipefail and the git status --porcelain check that prints git status/git diff and exits 1), commit that script, and replace each duplicated step in the workflow (the steps titled "Check for unexpected file changes") with a simple invocation of that script (e.g., run: ./check-clean-worktree.sh) so all jobs reuse the same implementation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 394-402: The "Check for unexpected file changes" step is
duplicated across multiple CI jobs; extract the logic into a single executable
script named check-clean-worktree.sh, add the exact content shown
(#!/usr/bin/env bash with set -euo pipefail and the git status --porcelain check
that prints git status/git diff and exits 1), commit that script, and replace
each duplicated step in the workflow (the steps titled "Check for unexpected
file changes") with a simple invocation of that script (e.g., run:
./check-clean-worktree.sh) so all jobs reuse the same implementation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: df793ea7-68fa-4ecb-8583-3440a3a868cc
📒 Files selected for processing (1)
.github/workflows/ci.yml
af6f1c9 to
2c65ff4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #27084 +/- ##
==========================================
- Coverage 73.20% 73.20% -0.01%
==========================================
Files 1531 1531
Lines 121832 121808 -24
Branches 14701 14699 -2
==========================================
- Hits 89190 89169 -21
- Misses 31625 31645 +20
+ Partials 1017 994 -23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ref #27083 ref 353552f Here's the prompt I gave to Claude Sonnet 4.6: > When I ran `cd ghost/core && yarn test:e2e` on a fresh clone, new > snapshots were generated, and `git status` wasn't clean. That's not > what I want! > > Update the GitHub CI scripts so that, if `git diff`/`git status` isn't > empty after running tests, CI fails.
2c65ff4 to
a323377
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
579-586: LGTM!Consistent with the other test jobs.
Consider extracting this check into a small composite action (e.g.,
.github/actions/check-git-clean) if you anticipate adding it to more test jobs in the future. For now, the duplication is minimal and acceptable.♻️ Optional: Composite action for reuse
Create
.github/actions/check-git-clean/action.yml:name: Check for unexpected file changes description: Fails if git working tree is dirty after tests runs: using: composite steps: - shell: bash run: | if [ -n "$(git status --porcelain)" ]; then echo "Tests generated unexpected file changes. Commit them before merging:" git status git diff exit 1 fiThen replace each inline step with:
- name: Check for unexpected file changes uses: ./.github/actions/check-git-clean🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/ci.yml around lines 579 - 586, The inline shell step named "Check for unexpected file changes" is duplicated and should be extracted into a reusable composite action; create a composite action (e.g., named check-git-clean) that runs the existing bash snippet to fail when git status is dirty, then replace each inline step with a uses entry that invokes that composite action (keep the displayed name "Check for unexpected file changes" for clarity).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 579-586: The inline shell step named "Check for unexpected file
changes" is duplicated and should be extracted into a reusable composite action;
create a composite action (e.g., named check-git-clean) that runs the existing
bash snippet to fail when git status is dirty, then replace each inline step
with a uses entry that invokes that composite action (keep the displayed name
"Check for unexpected file changes" for clarity).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 12b8fe89-7136-4ed5-a384-1ed4fb9190bd
📒 Files selected for processing (1)
.github/workflows/ci.yml
|
CI is failing, which will be fixed with TryGhost/Ghost-CLI#2109. |
|



ref #27083
ref 353552f
Here's the prompt I gave to Claude Sonnet 4.6: