Repository navigation
CI: scaffold identity via GIT_AUTHOR_*/GIT_COMMITTER_* env, never git config --global - #11
Conversation
…v, never `git config --global` A lane mirroring the CI step on a workstation rewrote the operator's ~/.gitconfig on 2026-09-03 and changed the author of another lane's in-flight commits. The scaffold, adopt, update-shape and the test fixtures already take identity per invocation from these variables; the workflow now does the same, so nothing in this repository writes global git config anywhere. Lane: repo-shape Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_015WekBEXf55Xv64psGe5t3T
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe CI workflow now exports Git author and committer identity through $GITHUB_ENV instead of running File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. If the environment variables are not honored by every scaffolded Git invocation, generated commits could receive the wrong author or committer identity, which persists in repository history. Reverting stops the behavior, and the affected commits can be regenerated or rewritten, so the impact is bounded and repairable.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
With no global git config on the CI runner (the previous commit stopped writing one), setup.sh and scaffold-project.py refused for want of an elector. Per-invocation identity is now the first fallback, the config the second, so a workstation with no ~/.gitconfig user and a runner with only GIT_AUTHOR_* behave the same. Lane: repo-shape Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_015WekBEXf55Xv64psGe5t3T
There was a problem hiding this comment.
🟢 Approval recommended
The workflow change correctly scopes Git identity to the job environment and removes the risky global gitconfig mutation, with only a minor PR-description consistency nit noted.
Pull request overview
Updates the CI test workflow to set Git author/committer identity via environment variables (GIT_AUTHOR_/GIT_COMMITTER_) instead of writing to global Git configuration, preventing accidental modification of an operator’s ~/.gitconfig when steps are mirrored locally.
Changes:
- Replace
git config --global user.*usage with$GITHUB_ENVexports ofGIT_AUTHOR_*/GIT_COMMITTER_*. - Add explanatory workflow comments documenting why global Git config must not be used in CI.
File summaries
| File | Description |
|---|---|
| .github/workflows/tests.yml | Switch CI Git identity setup from global gitconfig writes to per-job environment variables. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # Per-invocation identity, never `git config --global`: a lane that | ||
| # mirrors this step on a workstation must not be able to rewrite the | ||
| # operator's ~/.gitconfig (it happened on 2026-09-03). The scaffold, | ||
| # adopt, update-shape and the test fixtures all honour these variables. |
…MITTER_NAME The per-invocation identity is an elector now, so the negative path is reachable only with both the env and the config suppressed. Lane: repo-shape Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_015WekBEXf55Xv64psGe5t3T
There was a problem hiding this comment.
🟡 Changes recommended
setup.sh still prefers gh api user before GIT_AUTHOR_NAME, which can override the intended per-invocation identity and undermines the PR’s stated behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Lite
| if [ -z "$ELECTED_BY" ] && [ "$LOCAL_MODE" -ne 1 ]; then | ||
| ELECTED_BY="$(gh api user --jq .login 2>/dev/null || true)" | ||
| fi | ||
| if [ -z "$ELECTED_BY" ]; then | ||
| ELECTED_BY="$(git config user.name 2>/dev/null || true)" | ||
| # Per-invocation identity first (GIT_AUTHOR_NAME), then the repo/global | ||
| # config, then the gh login — never a global config WRITE. | ||
| ELECTED_BY="${GIT_AUTHOR_NAME:-$(git config user.name 2>/dev/null || true)}" | ||
| fi |
| # Per-invocation identity first, then the config — never a global | ||
| # config write (see the CI workflow note, 2026-09-03). | ||
| elected_by = (os.environ.get("GIT_AUTHOR_NAME") or "").strip() or git_out(["config", "user.name"], cwd=SHAPE_ROOT) |
…h (env is an override map) Lane: repo-shape Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_015WekBEXf55Xv64psGe5t3T
|
There was a problem hiding this comment.
🟡 Changes recommended
setup.sh currently fetches the gh login before checking GIT_AUTHOR_NAME, which prevents env override and contradicts the documented selection order.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
setup.sh:272
- The elector selection order here doesn’t match the comment, and it also means GIT_AUTHOR_NAME won’t be honored whenever
gh api usersucceeds (because the gh login is fetched first). If the intent is “per-invocation env first, then git config, then gh login”, reorder the blocks accordingly so env can override and the comment stays accurate.
if [ -z "$ELECTED_BY" ] && [ "$LOCAL_MODE" -ne 1 ]; then
ELECTED_BY="$(gh api user --jq .login 2>/dev/null || true)"
fi
if [ -z "$ELECTED_BY" ]; then
# Per-invocation identity first (GIT_AUTHOR_NAME), then the repo/global
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
| # `env` is an OVERRIDE map merged over the process environment by | ||
| # run_script, and the fixtures set GIT_AUTHOR_NAME there; the scaffold | ||
| # takes that per-invocation identity as an elector before the config, so | ||
| # the no-elector path is reachable only with BOTH blanked (empty string | ||
| # falls through to the config, which is /dev/null here). |



Lane: repo-shape
Two agents of this lane mirrored the CI step's
git config --global user.*lines on the workstation on 2026-09-03 and rewrote the operator's ~/.gitconfig, changing the author of another lane's in-flight commits. The tooling (scaffold, adopt, update-shape, test fixtures) already takes identity per invocation from GIT_AUTHOR_/GIT_COMMITTER_; the workflow now sets those into $GITHUB_ENV instead, so nothing in this repository writes global git config anywhere. Verified:grep -rn 'config --global'over yml/py/sh finds nothing.🤖 Generated with Claude Code
https://claude.ai/code/session_015WekBEXf55Xv64psGe5t3T
Summary by Sourcery
Use per-invocation Git identity throughout shape scaffolding and CI without writing global Git configuration.
Bug Fixes:
Enhancements:
CI:
Tests: