Skip to content

workflows: bind bot token to GITHUB_TOKEN, not GH_TOKEN - #373

Merged
max-sixty merged 1 commit into
mainfrom
tend-token-recommendation
May 2, 2026
Merged

max-sixty merged 1 commit into
mainfrom
tend-token-recommendation

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Summary

  • Tend's design intent is one bot identity everywhere in a job. Setting GH_TOKEN only overrides the gh CLI — third-party actions and subprocesses still see the auto-injected github-actions[bot] token.
  • GITHUB_TOKEN is auto-injected by GitHub Actions and read by most tools, and claude-code-action already overwrites it internally, so binding the bot token there gives consistent identity across the job.
  • Updates the generator templates and the composite action's own shell steps. Adds a paragraph to docs/security-model.md "Token assignment" explaining the convention.
  • The generated tend-*.yaml workflows are not touched here — they regenerate from the next published release via the nightly uvx tend@latest init.

Test plan

  • uv run pytest (164 passed)
  • pre-commit run --all-files (clean)
  • CI green on this PR

🤖 Generated with Claude Code

Tend's design intent is one bot identity everywhere in a job. Setting
`GH_TOKEN` only overrides the `gh` CLI — third-party actions and
subprocesses still see the auto-injected `github-actions[bot]` token.
`GITHUB_TOKEN` is auto-injected by GitHub Actions and read by most
tools, and `claude-code-action` already overwrites it internally, so
binding the bot token there gives consistent identity across the job.

Updates the generator templates, the composite action's own shell
steps, and adds a paragraph to the security-model.md "Token assignment"
section. The generated tend-*.yaml workflows are not touched here —
they regenerate from the next published release via the nightly
`uvx tend@latest init`.

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit 890d2d0 into main May 2, 2026
5 checks passed
@max-sixty
max-sixty deleted the tend-token-recommendation branch May 2, 2026 19:28
@max-sixty max-sixty mentioned this pull request May 8, 2026
2 of 3 tasks
max-sixty added a commit that referenced this pull request May 8, 2026
## Summary

- Bumps generator version 0.0.16 → 0.0.17
- 57 commits since 0.0.16; the headline change is #375 (gate
fork-exposed scheduled workflows on `github.repository_owner` so
consumer-repo forks no-op on the cron and stop generating cross-repo
CheckSuite notifications back to `tend-agent`)
- Other notable changes: workflow header stamps tend version (#316),
bot-token rebound to `GITHUB_TOKEN` (#373), review skill
draft/light-mode + polling improvements (#308, #311, #315, #362)

## Test plan

- [x] `uv run pytest` — 188 passed
- [x] `pre-commit run --all-files` — clean
- [ ] After merge: tag 0.0.17, PyPI publishes, regenerate tend's own
workflows with `uvx tend@latest init`

Co-authored-by: Claude <[email protected]>
max-sixty added a commit that referenced this pull request May 8, 2026
## Summary

Regenerates `.github/workflows/tend-*.yaml` against the freshly
published 0.0.17. Brings tend's own deployment in line with what
consumers will see after their nightly regen:

- **Fork guard (#375)**: scheduled jobs now carry `if:
github.repository_owner == 'max-sixty'`, so forks of tend (or
fork-of-fork chains) no-op on the cron instead of failing on missing
secrets and pinging `tend-agent` with cross-repo CheckSuite
notifications.
- **Header (#316)**: workflow comment now reports the generator version
it was rendered from.
- **GITHUB_TOKEN rebind (#373)**: the bot token is now exported as
`GITHUB_TOKEN` (previously `GH_TOKEN`).

## Test plan

- [x] `uvx [email protected] init` produced a clean diff (8 files, +19/-16)
limited to header, `if:` guard, and the token env-var rename
- [ ] Watch tomorrow's scheduled runs to confirm the guard does not gate
out tend's own canonical workflow

Co-authored-by: Claude <[email protected]>
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.

2 participants