You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ci: Classify a PR's changed files in a tested script - #188
The docs-only skip (#175) decided inline, in ci.yml's shell, whether a PR skips the build and tests. That rule decides whether required checks run, yet it had no automated tests. Copilot asked for them on the port to mpaulosky/atelier-store#95, so the rule now lives in a tested script here too, keeping this reference in step.
.github/scripts/detect_changes.py lists the changed files (git diff --name-only --no-renames -z against the base) and appends code=true or code=false to $GITHUB_OUTPUT. The rule is unchanged: docs-only when every path is under docs/ or ends in .md; anything else, or an empty diff, runs the build. -z keeps file names with spaces or line breaks whole, and git's output is decoded by hand, because text=True would turn a \r in a name into \n. The first code path is logged with \r and \n escaped, so a file name can't start a workflow command such as ::error:: on the next log line.
The Detect Changes step keeps its push and manual-run shortcut and calls the script for pull requests. The job now matches atelier-store's exactly.
Testing
New test_detect_changes.py (23 tests) builds real git repos: docs-only, code, mixed, an empty diff, code moved into docs/, code renamed to .md, a deletion, file names with spaces and newlines, and a code path whose name holds \n::error:: and \r::warning:: (logged on one escaped line), plus each path's classification and the output line the job reads. All script tests: 181 passed, 1 skipped.
detect_changes.py holds the docs-only rule the Detect Changes job ran
inline: every path under docs/ or ending in .md skips the build, and
anything else, an empty diff or a rename out of code runs it. Its tests
build real git repos to cover docs-only, code, mixed, empty, rename,
delete and odd-filename changes. Found by review of the port to
mpaulosky/atelier-store#95.
Refs #144
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Git allows line breaks in file names, and the first code path is written
to the Actions log, so a name like "src/x\n::error::forged" could start
a workflow command. The path is logged with \r and \n escaped. Reading
git's output with text=True also turned a \r in a name into \n; it is
now decoded by hand.
Refs #144
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
For a one-file docs PR, this notice renders 1 files, and the new test currently codifies that grammar. Please pluralize file based on len(paths) and update the assertion accordingly.
The docs job listed Releases eight seconds after v0.0.20 was published,
GitHub's list didn't include it yet, and the run opened no blog PR for
PR #188. The job now passes the PRs it released, and the backfill lists
again, every 5s for up to a minute, until each has a Release. A release
that never appears is logged as a warning; the next run writes its post.
The posts and the tables use the same listing.
Refs #144
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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
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.
Summary
The docs-only skip (#175) decided inline, in
ci.yml's shell, whether a PR skips the build and tests. That rule decides whether required checks run, yet it had no automated tests. Copilot asked for them on the port to mpaulosky/atelier-store#95, so the rule now lives in a tested script here too, keeping this reference in step..github/scripts/detect_changes.pylists the changed files (git diff --name-only --no-renames -zagainst the base) and appendscode=trueorcode=falseto$GITHUB_OUTPUT. The rule is unchanged: docs-only when every path is underdocs/or ends in.md; anything else, or an empty diff, runs the build.-zkeeps file names with spaces or line breaks whole, and git's output is decoded by hand, becausetext=Truewould turn a\rin a name into\n. The first code path is logged with\rand\nescaped, so a file name can't start a workflow command such as::error::on the next log line.Detect Changesstep keeps its push and manual-run shortcut and calls the script for pull requests. The job now matches atelier-store's exactly.Testing
test_detect_changes.py(23 tests) builds real git repos: docs-only, code, mixed, an empty diff, code moved intodocs/, code renamed to.md, a deletion, file names with spaces and newlines, and a code path whose name holds\n::error::and\r::warning::(logged on one escaped line), plus each path's classification and the output line the job reads. All script tests: 181 passed, 1 skipped.main's ruleset.yamllint,actionlintandzizmorare clean, and the pre-push gate passed.Refs #144
🤖 Generated with Claude Code