Skip to content

ci: add needs-attention labeling automation - #2432

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

ci: add needs-attention labeling automation#2432
russellwheatley merged 3 commits into
masterfrom
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 the same automation added to react-native-firebase, firebaseui-web#1426, and FirebaseUI-iOS#1380:
    • On creation: newly opened issues immediately get the existing needs-attention label.
    • On an OP comment, open item (issue or PR): (re-)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

  • This repo already has both needs-attention and blocked: await customer response labels, so no manual label setup is needed.
  • 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 master, 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 the workflow added to react-native-firebase, firebaseui-web,
and FirebaseUI-iOS. Two behaviors:
- New issues/PRs (including from forks, via pull_request_target) get
  "needs-attention" immediately on creation.
- When the issue/PR author comments on an open item, "needs-attention"
  is (re-)added and "blocked: await customer response" is removed.
  Closed items get a short comment instead, pointing to a fresh
  issue/PR if still relevant.

Uses only the default GITHUB_TOKEN with an explicit permissions
block, so no repository/org settings changes are required.
@gemini-code-assist

Copy link
Copy Markdown

Note

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

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 f4f365a into master Jul 30, 2026
18 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in studio-2394994192-60a69 Jul 30, 2026
@russellwheatley
russellwheatley deleted the ci/op-response-label-automation branch July 30, 2026 14:44
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