ci: fail jobs that dirty the worktree (#29720)

## Why

CI jobs should not silently leave tracked changes or untracked files in
the repository worktree.

## What

- Add a shared final worktree-cleanliness action to 19 checkout-bearing
PR and main CI jobs.
- Ignore the intentional SDK scratch directory and nested V8 checkout.
- Pin Bazelisk in shared CI setup so `.bazelversion` remains
authoritative, avoiding `MODULE.bazel.lock` deltas on Windows runners.
- Leave `rust-ci-full` and release-only workflows unchanged.
- Update `AGENTS.md` to discourage review bots from asking for
`MODULE.bazel.lock` changes.
This commit is contained in:
Adam Perry @ OpenAI
2026-06-24 11:06:35 -07:00
committed by GitHub
parent 390b73133b
commit 93c79046d6
12 changed files with 103 additions and 3 deletions
+20
View File
@@ -58,6 +58,10 @@ jobs:
echo "codex=$codex" >> "$GITHUB_OUTPUT"
echo "workflows=$workflows" >> "$GITHUB_OUTPUT"
- name: Check for a clean worktree
if: always() && !cancelled()
uses: ./.github/actions/check-clean-worktree
# --- Fast Cargo-native PR checks -------------------------------------------
general:
name: Format / etc
@@ -83,6 +87,10 @@ jobs:
- name: Rust benchmark smoke test
run: just bench-smoke
- name: Check for a clean worktree
if: always() && !cancelled()
uses: ./.github/actions/check-clean-worktree
cargo_shear:
name: cargo shear
runs-on: ubuntu-24.04
@@ -103,6 +111,10 @@ jobs:
- name: cargo shear
run: cargo shear --deny-warnings
- name: Check for a clean worktree
if: always() && !cancelled()
uses: ./.github/actions/check-clean-worktree
argument_comment_lint_package:
name: Argument comment lint package
runs-on: ubuntu-24.04
@@ -154,6 +166,10 @@ jobs:
env:
RUST_MIN_STACK: "8388608" # 8 MiB
- name: Check for a clean worktree
if: always() && !cancelled()
uses: ./.github/actions/check-clean-worktree
argument_comment_lint_prebuilt:
name: Argument comment lint - ${{ matrix.name }}
runs-on: ${{ matrix.runs_on || matrix.runner }}
@@ -205,6 +221,10 @@ jobs:
target: ${{ runner.os }}
buildbuddy-api-key: ${{ secrets.BUILDBUDDY_API_KEY }}
- name: Check for a clean worktree
if: always() && !cancelled() && steps.argument_comment_lint_gate.outputs.run == 'true'
uses: ./.github/actions/check-clean-worktree
# --- Gatherer job that you mark as the ONLY required status -----------------
results:
name: CI results (required)