Skip to content

chore: regenerate workflows with tend 0.0.10 - #210

Merged
max-sixty merged 2 commits into
mainfrom
tend/update-workflows
Apr 9, 2026
Merged

max-sixty merged 2 commits into
mainfrom
tend/update-workflows

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

Summary

  • Regenerates tend-mention.yaml to match the current generator (0.0.10)
  • Restores bot-author filters on pull_request_review and pull_request_review_comment events — required because fork PRs don't have access to secrets, so the verify step's API calls would fail without this filter
  • Switches the verify step's GH_TOKEN from secrets.BOT_TOKEN to github.token for the same fork PR reason

These fixes were in the generator since #206 but the committed workflows were last regenerated with 0.0.9 (#196).

Test plan

  • CI passes
  • git diff between committed file and uvx tend@latest init --dry-run output shows no differences

🤖 Generated with Claude Code

The mention workflow was last generated with 0.0.9. Regenerating picks up
two fixes from the generator: bot-author filters on PR review events (required
for fork PRs without secret access) and using github.token in the verify step.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Comment thread .github/workflows/tend-mention.yaml Outdated
verify:
# Filter out bot's own reviews/comments at the job level. This is required
# (not just an optimization) because pull_request_review events on fork PRs
# do not have access to secrets, so the verify step's API calls would fail.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but then why aren't we filtering out those events on fork PRs?? rather than this filter?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right that we could also filter on fork PRs (e.g. github.event.pull_request.head.repo.full_name != github.repository). But the bot-self filter solves two problems at once:

  1. Fork PRs: The bot posting a review via tend-review (which uses pull_request_target and has secrets) fires pull_request_review: submitted, triggering tend-mention where secrets aren't available. Filtering out the bot's own reviews catches exactly this.
  2. Same-repo PRs: Prevents the bot from processing its own reviews even when secrets are available — avoids wasted compute and self-conversation loops.

A fork-only filter would handle (1) but not (2), so we'd need both checks. The bot-self filter alone covers both cases.

The comment is misleading though — it frames the filter as primarily about fork PRs when it's also independently useful. Happy to reword the comment if you'd prefer.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want it to process it's own reviews where possible; so just switch to filtering on fork PRs; and confirm that the notifications workflow will pick it up

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — switched to filtering on github.event.pull_request.head.repo.full_name == github.repository so the bot processes its own reviews on same-repo PRs. Fork PRs get filtered out, and the notifications workflow picks those up (it explicitly handles fork PR inline comments).

Comment thread .github/workflows/tend-mention.yaml Outdated
echo "should_run=false" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
GH_TOKEN: ${{ github.token }}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why this is better?!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two reasons:

  1. Always available: github.token works on fork PRs; secrets.BOT_TOKEN doesn't. This is defense-in-depth — if the if: filter fails to catch a fork event, the verify step still runs instead of crashing.
  2. Least privilege: The verify step only does read-only API calls (checking if the bot previously participated). It doesn't need BOT_TOKEN's elevated permissions. secrets.BOT_TOKEN is still used where it's needed — the reaction step and the handle job.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted — verify step uses secrets.BOT_TOKEN again.

Replace `user.login != bot` checks on review events with
`head.repo.full_name == github.repository` so the bot can process its
own reviews on same-repo PRs. Fork PRs (where secrets are unavailable)
are filtered out instead — the notifications workflow polls for those.

Also reverts GH_TOKEN in the verify step back to secrets.BOT_TOKEN.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@max-sixty
max-sixty merged commit 5c58104 into main Apr 9, 2026
8 of 11 checks passed
@max-sixty
max-sixty deleted the tend/update-workflows branch April 9, 2026 07:20
max-sixty added a commit that referenced this pull request Apr 10, 2026
Bumps generator version to 0.0.11 and syncs lockfile.

4 commits since 0.0.10: docs(review-reviewers) non-issue guidance (#213), workflow regeneration (#210), example config nightly/weekly fix (#211), install-tend skill cleanup (#209).

Co-Authored-By: Claude <[email protected]>
@max-sixty max-sixty mentioned this pull request Apr 10, 2026
max-sixty added a commit that referenced this pull request Apr 10, 2026
Bumps generator version to 0.0.11 and syncs lockfile.

4 commits since 0.0.10:
- docs(review-reviewers): mark bot re-approval as a non-issue (#213)
- chore: regenerate workflows with tend 0.0.10 (#210)
- fix: update example config nightly/weekly descriptions (#211)
- Clean up install-tend skill (#209)

> _This was written by Claude Code on behalf of Maximilian_

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