Skip to content

norm: auto-fix CI for run 30706503946 - #15

Merged
natevick merged 4 commits into
mainfrom
norm/ci-fix-30706503946
Aug 2, 2026
Merged

norm: auto-fix CI for run 30706503946#15
natevick merged 4 commits into
mainfrom
norm/ci-fix-30706503946

Conversation

@natevick

@natevick natevick commented Aug 1, 2026

Copy link
Copy Markdown
Owner

⚠️ Auto-generated fix — please review. Produced automatically by norm-webhooks
in response to a CI failure; it was not written by a human. Review carefully before merging.

Auto-fix for CI failure on d385a73acae5508c64cabb55ae7da74417290e86 (run 30706503946).

Run: https://github.com/natevick/dotfiles/actions/runs/30706503946

failed-job logs (fetched at fix time)
shellcheck	shellcheck plain shell scripts	2026-08-01T15:42:27.1253768Z ##[group]Run shellcheck install.sh home/*.sh
shellcheck	shellcheck plain shell scripts	2026-08-01T15:42:27.1255068Z ^[[36;1mshellcheck install.sh home/*.sh^[[0m
shellcheck	shellcheck plain shell scripts	2026-08-01T15:42:27.1256749Z ^[[36;1m# ~/.local/bin shims. These shadow real binaries on $PATH (gh, git),^[[0m
shellcheck	shellcheck plain shell scripts	2026-08-01T15:42:27.1258396Z ^[[36;1m# so they are the most consequential shell in the repo  they were^[[0m
shellcheck	shellcheck plain shell scripts	2026-08-01T15:42:27.1259852Z ^[[36;1m# previously outside the linter's reach entirely.^[[0m
shellcheck	shellcheck plain shell scripts	2026-08-01T15:42:27.1261050Z ^[[36;1mshellcheck home/dot_local/bin/*^[[0m
shellcheck	shellcheck plain shell scripts	2026-08-01T15:42:27.1262346Z ^[[36;1mshellcheck --shell=bash home/dot_claude/modify_settings.json^[[0m
shellcheck	shellcheck plain shell scripts	2026-08-01T15:42:27.1313405Z shell: /usr/bin/bash -e {0}
shellcheck	shellcheck plain shell scripts	2026-08-01T15:42:27.1314346Z ##[endgroup]
shellcheck	shellcheck plain shell scripts	2026-08-01T15:42:27.8275211Z 
shellcheck	shellcheck plain shell scripts	2026-08-01T15:42:27.8276761Z In home/dot_local/bin/executable_claude-memory-backup line 18:
shellcheck	shellcheck plain shell scripts	2026-08-01T15:42:27.8278639Z cd "$WORK" && git pull --rebase -q origin main 2>/dev/null || true
shellcheck	shellcheck plain shell scripts	2026-08-01T15:42:27.8280809Z            ^-- SC2015 (info): Note that A && B || C is not if-then-else. C may run when A is true.
shellcheck	shellcheck plain shell scripts	2026-08-01T15:42:27.8282489Z 
shellcheck	shellcheck plain shell scripts	2026-08-01T15:42:27.8282790Z For more information:
shellcheck	shellcheck plain shell scripts	2026-08-01T15:42:27.8284244Z   https://www.shellcheck.net/wiki/SC2015 -- Note that A && B || C is not if-t...
shellcheck	shellcheck plain shell scripts	2026-08-01T15:42:27.8325410Z ##[error]Process completed with exit code 1.

Norm and others added 4 commits August 1, 2026 08:14
Agent accounts now hold one fine-grained PAT per GitHub org under
~/.config/github-pats/<owner>, selected by lowercasing the owner from the remote
URL. Scope is enforced server-side, so the tokens are narrow enough to be
ambient — a routine fetch or `gh pr view` no longer costs an approval
round-trip.

Guarded on .agent: on a machine without the helper installed this block would
break github.com auth outright, so it must never render on the Mac. Verified
both ways with `chezmoi execute-template --override-data`.

Two details that are load-bearing and easy to lose:
- `helper =` resets the list first. For multi-valued keys git APPENDS, so
  without the reset the `!gh auth git-credential` helper above still gets
  consulted first.
- useHttpPath=true, or git omits `path=` from the credential request and the
  helper has no owner to key a token on.
PR #12 added a gitconfig pointing at a credential helper the repo did not
contain, so a rebuilt agent host got config with nothing behind it. Ship the
three shims it depends on:

  gh                        injects the per-org PAT, resolving owner from
                            -R/--repo, GH_REPO, an `gh api` path, a POSITIONAL
                            owner/repo, or the cwd's origin. No default-org
                            fallback: a repo-less call runs unauthenticated
                            rather than quietly carrying an org credential.
  git                       refuses force-push and branch-delete, audits, and
                            notifies. An ACCIDENT CATCHER, not a control —
                            anything running as the agent can call /usr/bin/git
                            or set NORM_ALLOW_FORCE=1. It fails OPEN to real git
                            by design; breaking every git call would be worse
                            than missing one force-push.
  git-credential-github-org one PAT per org, keyed on the remote URL's owner.

All three append to ~/.local/state/norm-gh-audit.jsonl (0600, created before
first write — the ambient umask would otherwise leave it world-readable). The
token value is never logged.

Gated in .chezmoiignore on .agent: `gh` and `git` SHADOW the real binaries, so
on a host without ~/.config/github-pats they would break github.com auth
outright. Verified both renderings with --override-data.

Also wire home/dot_local/bin/* into the shellcheck job. Those files shadow real
binaries and were outside the linter's reach; all four pass clean (0.11.0).
@natevick
natevick merged commit 19a9fe0 into main Aug 2, 2026
2 checks passed
@natevick
natevick deleted the norm/ci-fix-30706503946 branch August 2, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant