fix(agent): route issue-opened events (event_name is workflow_call in reusable wf)

The shared agent.yml is a reusable (workflow_call) workflow, so on Gitea
github.event_name evaluates to 'workflow_call' — not the original 'issues'/
'issue_comment'. route.sh branched on EVENT == "issues", so issue-opened runs
scanned the empty comment body and skipped the @pm fallback, exiting 1 with
"no known agent mentioned" (runs #393/#394). Comment runs were unaffected
because the @mention lives in $BODY.

Discriminate on the comment id (CID) instead, which IS reliably forwarded in
the event payload: empty => issue-opened (scan issue body, default @pm), set
=> comment (scan comment body). Also add .gitignore for .env.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Felix Faerber
2026-07-04 10:02:50 +03:00
co-authored by Claude Opus 4.8
parent d8d4ba71c0
commit b3deee7412
3 changed files with 11 additions and 4 deletions
+5 -1
View File
@@ -56,7 +56,11 @@ jobs:
SCRIPTS: ${{ github.workspace }}/.agents-workflow/.gitea/workflows/scripts
BODY: ${{ github.event.comment.body }} # event text via env, never inline in shell
IBODY: ${{ github.event.issue.body }}
EVENT: ${{ github.event_name }}
# Comment-vs-issue discriminator. Do NOT use github.event_name here: this is a REUSABLE
# (workflow_call) workflow, so on Gitea event_name is 'workflow_call', not the original
# 'issues'/'issue_comment'. The comment id, however, is reliably present in the forwarded
# payload — empty on an issue-opened event, set on a comment event.
CID: ${{ github.event.comment.id }}
IS_PR: ${{ github.event.issue.pull_request }}
NUM: ${{ github.event.issue.number }}
GT: ${{ secrets.GITEA_TOKEN }}