ci: restrict Pi workflow trigger to repo admins #2
No reviewers
Labels
No labels
dependencies
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
alex/.profile!2
Loading…
Reference in a new issue
No description provided.
Delete branch "pi/restrict-trigger-to-admins"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Restricts the Pi AI Agent workflow so that only repo admins can invoke it.
Why
Today the
pi-agentjob runs for anyissue_commentstarting with/pi, meaning any registered user on the forge could trigger the agent (and the LLM spend + repo write access that comes with it). The earlier bot-setup report (docs/setup-pi-bot.md) flagged this as a watch-out:How
Adds an
author_associationguard to the jobif:OWNER→ repository owner (covers personal forges like this one)MEMBER→ org member with admin rights (covers org-owned repos)Non-admin comments (
CONTRIBUTOR,NONE,FIRST_TIME_CONTRIBUTOR, …) are now silently ignored by the job.Scope
This forge currently has a single Pi workflow —
.forgejo/workflows/pi.yml— so this one PR covers it.Refs #1.