Repository navigation
fix(ci): run the vale-autofix scope helper from dev, not the PR branch - #1938
Merged
Merged
Conversation
#1937 made the vale-autofix workflow call scripts/vale-scope.mjs from the checked-out PR branch. A branch cut before that merged does not have the file, so the first new step failed with "Cannot find module" and every later step was skipped. Every open docs PR branched earlier would show a failed vale-autofix check, and the autofix would not run at all. Found by reopening a backfill PR as a test. The workflow now extracts the helper and its one dependency from origin/dev (git archive) and runs that copy. This also means the job, which has a write token, no longer runs a script the PR itself supplies. A test reads the workflow and fails if any call goes back to the repo path. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Code ReviewNo blocking issues found. What I checked
Non-blocking notes
|
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
#1937 made
vale-autofix.ymlrunscripts/vale-scope.mjsfrom the checked-out PR branch. A branch cut before #1937 merged doesn't have that file, so the first new step fails withCannot find module '.../scripts/vale-scope.mjs'. Every later step is skipped, so the autofix doesn't run at all.This turns the check red on every open docs PR that was branched before #1937 merged, until the author updates their branch from
dev. I found it by reopening a backfill PR as a test (#1919).Change
The workflow now extracts
scripts/vale-scope.mjsand its one dependency (scripts/quality/lib/scope.mjs) fromorigin/devwithgit archive, and runs that copy. It no longer depends on the PR branch having the files.This also means the job, which has a write token and pushes commits, no longer runs a script that the PR itself supplies.
Testing
scripts/vale-scope.mjs, and ran the helper fromdev's copy. It computed the changed lines of all 22 changed pages.scripts/test-vale-scope.mjsreads the workflow and fails if any call goes back to the repo path, or if the extraction isn't before the first use.npm run test:scriptspasses.After this merges, I'll close and reopen #1919 to confirm the autofix runs and leaves the rest of each page alone.
🤖 Generated with Claude Code