Repository navigation
feat: add notifications workflow for polling GitHub notifications - #96
Conversation
Adds a scheduled workflow (every 15 minutes) that checks the bot's GitHub notifications, responds to unhandled mentions, and clears dealt-with items. Includes security guardrails for prompt injection via untrusted notification sources. Closes #94 Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
fix the lints? |
Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Fixed — expanded |
| 2. **Check scope.** Only process notifications from this repository | ||
| (`$GITHUB_REPOSITORY`). Mark cross-repo notifications as read without acting: | ||
| ```bash | ||
| gh api notifications/threads/{id} -X PATCH |
There was a problem hiding this comment.
this is too strong, it's fine to read the notifications, we just want to be careful about acting on them
There was a problem hiding this comment.
Good call — softened this. The fetch no longer pre-filters to this repo, and cross-repo notifications are read and understood rather than blindly marked as done. Acting on them (creating issues, PRs, comments outside the org) is still restricted.
There was a problem hiding this comment.
Good call — updated to fetch all notifications and softened the cross-repo policy. Now it reads and understands cross-repo notifications but applies extra caution before acting (only responds to direct mentions with straightforward requests, no code changes in other repos).
Cross-repo notifications can be read and understood; only acting on them (creating issues, PRs, comments) needs caution. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Read all notifications instead of filtering to current repo only. Cross-repo notifications are now read and understood but acted on with extra caution, rather than being blanket-ignored. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Summary
Adds a
notificationsscheduled workflow that polls the bot's GitHub notifications every 15 minutes, responds to unhandled items, and marks handled ones as read. This addresses two gaps:pull_request_review_commentfor secrets-bearing workflows)What's included
generate_notifications()inworkflows.py, registered inGENERATORS, added toKNOWN_WORKFLOWSplugins/tend-ci-runner/skills/notifications/SKILL.mdwith a multi-step workflow: fetch notifications, classify security risk, check if already handled, respond, mark readSecurity
The skill includes explicit prompt injection mitigations since notifications can originate from untrusted sources without maintainer oversight:
$GITHUB_REPOSITORYauthor_associationbefore acting — untrusted users get limited responsesDefault schedule
Runs every 15 minutes (
*/15 * * * *), overridable via:Test plan
uvx tend init --dry-runshowstend-notifications.yamlin outputCloses #94