Repository navigation
fix(sync): print counts only in the template-sync open job's log - #160
Merged
Merged
Conversation
giulmonte
previously approved these changes
Nov 24, 2026
The log of a public repository is readable by anyone. A --write run in a workflow printed the full comparison table and a finding line per stale file, and template-sync-pr.sh printed the file list. In a workflow run (GITHUB_ACTIONS=true) both print counts only now. By hand they keep the full detail, which is the audit view. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Enrico Lionello <enri3l@monte3l.com>
The review found paths that still printed names under CI: the refusal messages, the commit call's stderr and errors, gh pr close and gh pr create, and the error messages of the plan job. They now say how many, or only that a call failed. A --write leg prints only how many copies it refreshed, and a copy held for its job names is not mentioned. By hand nothing changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Enrico Lionello <enri3l@monte3l.com>
enri3l
force-pushed
the
fix/sync-log-counts
branch
from
November 24, 2026 14:10
88baf60 to
91e2c80
Compare
giulmonte
approved these changes
Nov 24, 2026
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.
What and why
This repository is public, so the log of the
template-sync.ymlopenjob is readable by anyone. I read the log of a real run, not only the scripts. It held more than the knowntemplate-sync-pr.shlines, and an invariants review of the first version of this PR found more that still leaked under CI.What the log showed, and what is fixed (in a workflow run,
GITHUB_ACTIONS=true):--writestep printed the full comparison table and a finding line per stale file, with its path and how far it is out of date. It now prints onlyrefreshed N copies.template-sync-pr.shprinted the repository, the file list, the branch, the title, agit diff --stattable and the commit authors of an older pull request. It now printsN file(s), M bytes.none is sent: ...,got: ..., the modes). They now say how many.ghcall printedgh's own message, which holds the repository, the branch and the title: the commit call,gh pr create,gh pr view,gh pr close(which also reports the title and the deleted branch) and every other call. In a workflowgh's stderr is dropped and the script says only that a call failed. The commit errors are counted.template-sync.mjserror messages (repository missing or private, a read that failed withgh's first line, a template that could not be rendered) name no repository, file orghtext under CI, in the plan job too (--json, no--write). One flag,redact, decides that.Run by hand, all of it is unchanged: that is the audit view.
What the log still shows, and why
actions/checkoutprint it, not these scripts. The names are already public insync.json.Known, left as it was
jq) exits 1, the same code as a refusal, and can print what the tool prints. The script has noERRtrap and does not use the 3-versus-gh-code convention oftemplate-sync.mjs. Both predate this change.template-sync-pr.sh.How you checked it
tests/sync-log-public.test.mjsis a behavioural ratchet. It runstemplate-sync-pr.shin CI mode against a stubghthat puts a distinctive repository, file, branch, title and author into everything it prints and every error, through the success path, an existing pull request, an older pull request closed and left open, and nine failing calls, plus the refusals. None of those strings may reach stdout or stderr (the URL line is taken out first). The same runs by hand must show them, so the check could have failed. A static backstop makes a new$expansion in a print statement reviewed.tests/template-sync-cli.test.mjsdrivestemplate-sync.mjsthrough a private repository, a missing one, a failed read and an unrenderable template with each option set (--write,--json,--check, none).main, 27 of the new tests fail. The fullnode --test "tests/*.test.mjs"run passes 461 of 461, both withGITHUB_ACTIONSunset and with it exported astrue.shellcheck,actionlintandnode design/source/docs-kit/build.mjs --checkpass.gh pr close --helpdoes not say what it prints or on which stream, so both streams are silenced under CI instead of guessed.tests/sync-log-public.test.mjsis wired into the stop hook, so editing either script or either workflow runs it.mainafter feat(sync): refresh a repository's extra copies of a starter #159 (thetwinschange) merged: no conflicts. Its tests go throughrunSyncandsync_, soGITHUB_ACTIONSis cleared for them.Checklist
git commit -s) and signedfix(sync): print counts only in the template-sync open job's logNot done: I did not run the real sync, so the first scheduled run is the live test of the new log.
🤖 Generated with Claude Code