Skip to content

ci: add needs-attention labeling when OP responds - #1426

Merged
russellwheatley merged 4 commits into
mainfrom
ci/op-response-label-automation
Jul 30, 2026
Merged

ci: add needs-attention labeling when OP responds#1426
russellwheatley merged 4 commits into
mainfrom
ci/op-response-label-automation

Conversation

@russellwheatley

@russellwheatley russellwheatley commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds an issue_comment + issues:opened workflow, mirroring react-native-firebase's issue-labels automation, with one extra behavior on top:
    • On creation: newly opened issues immediately get the needs attention label.
    • On an OP comment, open item (issue or PR): adds needs attention and removes blocked: await customer response (if present).
    • On an OP comment, closed item: posts a short comment noting the item is closed and suggesting a new issue/PR if still relevant.
  • Uses only the default GITHUB_TOKEN, with permissions: {} at the workflow level and issues: write scoped per-job (no pull-requests: write — every call here goes through the Issues API regardless of whether the target is an issue or PR). No repository/org settings changes required.
  • actions/github-script is pinned to the underlying commit SHA for v9.0.0 rather than the annotated tag object's SHA (which 422s on a plain commit lookup and trips zizmor's impostor-commit check).

Notes

  • An earlier revision of this PR also labeled newly opened PRs immediately via pull_request_target, but this repo's mandatory zizmor security scan flags pull_request_target as a fundamentally insecure trigger — it can't be made safe enough for that gate, so it was dropped. New PRs still get labeled as soon as the OP comments, via the existing issue_comment flow.

Test plan

  • Merge to main, then open a new issue and confirm it's immediately labeled needs attention.
  • Comment as the issue/PR author on an open issue/PR and confirm labels swap as expected.
  • Comment as the author on a closed issue and confirm the explanatory comment is posted.

Mirrors react-native-firebase's issue-labels workflow: when the issue
or PR author comments on an open item, add the "needs attention"
label and clear "blocked: await customer response". Closed items get
a short comment pointing the author to open a fresh issue/PR instead.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

Adds issues:opened and pull_request_target:opened triggers so new
items get "needs attention" immediately, without waiting for an OP
comment. pull_request_target (rather than pull_request) is used so
labeling still works for PRs from forks, since it runs with the base
repo's token/permissions instead of being downgraded to read-only.
zizmor (mandatory security scan on this repo) flagged pull_request_target
as a fundamentally insecure trigger, and both permissions entries as
overly broad at the workflow level.

- Drop the pull_request_target trigger and its "label new PRs on open"
  job entirely, since it can't be made safe enough for this org's
  security gate. New issues are still labeled immediately (issues:opened
  doesn't carry the same risk); new PRs are still labeled as soon as the
  OP comments, via the existing issue_comment flow.
- Move permissions to job level (issues: write only) instead of the
  workflow level, and set permissions: {} at the top. pull-requests: write
  was dropped entirely - every API call here (addLabels/removeLabel/
  createComment) goes through the Issues API regardless of whether the
  target is an issue or PR, so it was never actually needed.
v9.0.0 is an annotated tag; the SHA copied from react-native-firebase's
workflow (d746ffe3...) is the tag *object*'s SHA, not the commit it
points to, so it 422s on a plain commit lookup. zizmor's impostor-commit
check flags this as a version-comment mismatch. Repin to the underlying
commit (3a2844b7...), which still corresponds exactly to v9.0.0.
@russellwheatley
russellwheatley merged commit 24fd2ea into main Jul 30, 2026
16 checks passed
@russellwheatley
russellwheatley deleted the ci/op-response-label-automation branch July 30, 2026 14:45
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