Skip to content

fix(ci): run the prune scripts with bash; their executable bit never reached git - #667

Merged
doublegate merged 1 commit into
mainfrom
fix/v3.7.1-cleanup-exec
Nov 16, 2026
Merged

doublegate merged 1 commit into
mainfrom
fix/v3.7.1-cleanup-exec

Conversation

@doublegate

@doublegate doublegate commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

The preview cleanup never ran: exit 126

The Preview environment cleanup workflow's first real run on main (run 43830700505, triggered by v3.7.1's branch deletion) failed both jobs with exit 126, permission denied, before either script did anything.

Both scripts/ci/prune-*.sh are recorded as 100644. They were committed from worktrees with core.fileMode=false (the workspace's NAS rule), so the local chmod +x was never staged. My stub-gh tests ran them from the working tree, where they were executable, so they could not catch this.

Fix

  • The workflow runs bash scripts/ci/<script>, so the mode no longer matters.
  • The index now records 100755 for both scripts.

I checked every other workflow for the same failure: every other script run directly is 100755, and render_privacy.py is run as python3 ....

Verification

actionlint and markdownlint are clean, and the anchor audit passes. The real proof is the workflow's next run on main, which this PR's own branch deletion triggers.

🤖 Generated with Claude Code


Note

Low Risk
CI-only invocation change for cleanup scripts; no application or auth logic touched.

Overview
Preview environment cleanup failed on its first main run (v3.7.1) with exit 126 because prune-deployments.sh and prune-preview-environments.sh were checked in without the executable bit (core.fileMode=false in the commit trees).

Both jobs in .github/workflows/preview-env-cleanup.yml now invoke the scripts as bash scripts/ci/... instead of running them directly, with comments documenting the NAS/fileMode constraint. The changelog Unreleased section records the fix; the scripts’ executable bit is also set in git so local runs stay consistent.

Reviewed by Cursor Bugbot for commit fc312e3. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed preview deployment cleanup jobs that could fail when running their cleanup scripts.

…reached git

The preview-env-cleanup workflow's first real run on main, run
43830700505, triggered by v3.7.1's branch deletion, failed both jobs
with exit 126 ("permission denied") before either script did anything.
Both prune scripts are recorded as 100644. They were written and
committed in worktrees with core.fileMode=false, which is the
workspace's rule for trees touched from the NAS mirror, so the local
chmod +x was never staged. The stub-gh tests ran the scripts from the
working tree, where they were executable, so they could not see it.

Two fixes, either sufficient alone:
- The workflow invokes `bash scripts/ci/<script>`, so the mode no longer
  matters, with a comment saying why.
- The index records 100755 for both, via update-index --chmod=+x, which
  works with fileMode off.

Audited the rest of the workflows for the same failure. Every other
script a workflow runs directly is 100755; scripts/render_privacy.py is
100644 but is run as `python3 scripts/...`.

CHANGELOG [Unreleased] records the fix.

Gates: actionlint clean; markdownlint passed; release_anchor_audit 18/0.
The fix itself is proven only by the workflow's next run on main, which
this PR's merge triggers (its branch deletion).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Nov 16, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 0ea2fb39-1677-4320-8d37-5e449b6ff821)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T08:27:22.486711Z fc312e3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Both preview cleanup jobs now invoke their pruning scripts with bash instead of executing the script paths directly. The changelog records this change and the prior exit-126 failures.

Changes: Preview cleanup workflow

Layer / File(s) Summary
Run cleanup scripts through bash
.github/workflows/preview-env-cleanup.yml, CHANGELOG.md
The deployments and environments jobs invoke their pruning scripts with bash. The changelog records the earlier exit-126 failures and executable-bit handling.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: Minimal · up to fc312

The preview cleanup workflow should stop failing with exit 126, since both scripts now run through bash. No merge-blocking risk was found.

Pre-merge checks: Passed 4 · Inconclusive 4

Failed Failed checks: 4 inconclusive

Check name Status Explanation Resolution
Docs-As-Spec Sync Inconclusive Pull request inputs changed after this check was assessed; its verdict is no longer current. Re-run the check against the current pull request inputs.
Changelog Entry For User-Visible Changes Inconclusive Pull request inputs changed after this check was assessed; its verdict is no longer current. Re-run the check against the current pull request inputs.
No Unwrap/Expect/Panic On Untrusted Input Inconclusive Pull request inputs changed after this check was assessed; its verdict is no longer current. Re-run the check against the current pull request inputs.
Safety Comment On New Unsafe Blocks Inconclusive Pull request inputs changed after this check was assessed; its verdict is no longer current. Re-run the check against the current pull request inputs.
Passed Passed checks: 4 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the two prune scripts in the preview environment cleanup workflow now run through bash, and their executable bit is recorded in git. It matches the PR objectives and t…
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.
Full details: Title check

Explanation

The title names the main change: the two prune scripts in the preview environment cleanup workflow now run through bash, and their executable bit is recorded in git. It matches the PR objectives and the file summaries. It uses the conventional fix(ci) prefix and states the root cause, which is concise and specific enough for a teammate scanning history. The title is 80 characters, which is at the upper end but acceptable.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e76aeda and fc312e3.

Files selected for processing: 4

  • .github/workflows/preview-env-cleanup.yml
  • CHANGELOG.md
  • scripts/ci/prune-deployments.sh
  • scripts/ci/prune-preview-environments.sh

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions

Copy link
Copy Markdown

Antigravity review (Gemini via Ultra)

This trivial fix invokes the two preview-cleanup scripts explicitly via bash in preview-env-cleanup.yml and records the 100755 executable mode in git on prune-deployments.sh and prune-preview-environments.sh so the workflow no longer fails with exit code 126 when scripts originate from core.fileMode=false worktrees.

Blocking issues

None found.

Suggestions

  • .pre-commit-config.yaml: Since new scripts are authored in worktrees with core.fileMode=false where chmod +x is ignored by git, consider enabling check-shebang-scripts-are-executable from pre-commit-hooks (already pinned at v6.0.0 in this file, scoped to scripts/ and .github/scripts/) so future scripts committed as 100644 are caught before merge — especially for workflows that only run post-merge or on release tags (e.g., release.yml and pgo.yml).

Nitpicks

None.

Automated first-pass review by agy on a self-hosted runner -- not a human review.

@doublegate
doublegate merged commit b150717 into main Nov 16, 2026
30 checks passed
@doublegate
doublegate deleted the fix/v3.7.1-cleanup-exec branch November 16, 2026 09:39
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