Build phase of #663.
The internal/external gate read author_association only. The webhook payload
reports NONE for an org member whose membership is private, even while REST
reports MEMBER, so every issue filed by diffwireauto from 2026-09-17 on was
labelled user-submitted + priority:P2 + board:backlog on top of the labels it
was created with.
Two changes:
- Add INTERNAL_ACTORS, an explicit allowlist of internal automation accounts,
checked alongside the association set. The gate no longer depends on a
membership-visibility setting that anyone can flip back.
- Apply only the labels that are actually missing. addLabels only adds, so
defaulting a priority or board state onto an issue that already carries one
left it holding two of each and let the downstream label-to-board sync pick a
winner. An already-triaged issue is now a no-op.
Verified at build time: the workflow YAML parses and the embedded github-script
body passes node --check. Behaviour on a real issues:opened event cannot be
exercised from a branch, because issues: and workflow_dispatch both only run
from the default branch. That check is #665, including the negative test that an
externally-filed issue still gets triaged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>