Skip to content

Add contributor-input-needed triage workflow#6

Open
tidy-dev wants to merge 12 commits intomainfrom
tidy-dev/requested-changes-pr
Open

Add contributor-input-needed triage workflow#6
tidy-dev wants to merge 12 commits intomainfrom
tidy-dev/requested-changes-pr

Conversation

@tidy-dev
Copy link
Contributor

Introduce a new GitHub Actions workflow (.github/workflows/triage-contributor-input-needed.yml) that auto-applies a contributor-input-needed label when changes are requested, removes it when the PR author responds, posts warning comments after configured inactivity, and auto-closes stale PRs. Update README to document the new workflow and label, and adjust example usage files to wire the workflow into pull request and scheduled task flows (add PR synchronize/review triggers and a scheduled job). This automates follow-up on requested changes and reduces manual triage work.

Introduce a new GitHub Actions workflow (.github/workflows/triage-contributor-input-needed.yml) that auto-applies a contributor-input-needed label when changes are requested, removes it when the PR author responds, posts warning comments after configured inactivity, and auto-closes stale PRs. Update README to document the new workflow and label, and adjust example usage files to wire the workflow into pull request and scheduled task flows (add PR synchronize/review triggers and a scheduled job). This automates follow-up on requested changes and reduces manual triage work.
Give the triage contributor-input-needed workflow permission to write issues and update the example usages to match. This enables the workflow (and its example invocations) to create or modify issue state during triage tasks. Files updated: .github/workflows/triage-contributor-input-needed.yml, example-usage/triage-prs.yml, example-usage/triage-scheduled-tasks.yml.
Change the contributor-input-needed workflow to run as a scheduled job that scans open PRs for CHANGES_REQUESTED reviews and applies the contributor-input-needed label (skipping PRs already marked ready-for-review). Update the GH CLI steps to list matching PRs and add labels in a loop, removing reliance on a single github.event.pull_request.number. Reflect the trigger change in README and example usage by removing pull_request_review from workflow triggers and adjusting the example job/if conditions accordingly.
Add a new workflow input `external_label` (default: "external") and expose it as EXTERNAL_LABEL in job envs. Update gh pr list invocations to filter by the external label so the workflow only targets PRs marked as external when adding the contributor-input-needed label and when warning/closing stale contributor-input-needed PRs. This tightens scope to avoid affecting non-external PRs.
Delete the 'Add acknowledging comment' step from .github/workflows/triage-ready-for-review.yml. This removes the GH CLI command that posted an automatic "Thank you for your contribution! This pull request has been marked as ready for review." comment when marking PRs as ready for review.
Add handling for when the 'contributor-input-needed' label is applied: add a manage-labels-on-labeled job that removes the 'ready-for-review' label from the PR and update the workflow's expected triggers comment to include pull_request_target:labeled. Also update the example usage to trigger the workflow when the PR is labeled. Comment in apply-label explains schedule-based detection due to GITHUB_TOKEN privilege limitations.
@tidy-dev tidy-dev marked this pull request as ready for review February 18, 2026 16:33
@tidy-dev tidy-dev requested review from BagToad and Copilot February 18, 2026 16:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new reusable triage workflow to manage a contributor-input-needed label on PRs (auto-apply on CHANGES_REQUESTED, remove on author activity, warn/close on inactivity), and wires it into the documented example workflows.

Changes:

  • Added .github/workflows/triage-contributor-input-needed.yml reusable workflow to apply/remove labels and warn/close stale PRs.
  • Updated example usage workflows to trigger on PR synchronize and to call the new workflow from scheduled/comment-driven automation.
  • Updated README to list the new workflow/label; removed the “acknowledging comment” step from triage-ready-for-review.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
example-usage/triage-scheduled-tasks.yml Calls the new contributor-input-needed workflow from scheduled/comment triggers.
example-usage/triage-prs.yml Adds synchronize trigger and calls contributor-input-needed workflow for PR updates/label events.
README.md Documents the new workflow and required label.
.github/workflows/triage-ready-for-review.yml Removes the automatic acknowledging PR comment step.
.github/workflows/triage-contributor-input-needed.yml New reusable workflow implementing labeling, warning, and auto-close behavior.
Comments suppressed due to low confidence (3)

.github/workflows/triage-contributor-input-needed.yml:166

  • BOT_WARNING is computed from the first page of issue comments only; on PRs with >30 comments the prior warning comment may not be returned, leading to duplicate warnings and preventing closure. Paginate the comments request and/or embed a stable marker in the warning comment body so it can be reliably detected.
            # Check if the bot has already left a warning comment
            BOT_WARNING=$(gh api "repos/{owner}/{repo}/issues/$PR_NUM/comments" --jq "[.[] | select(.user.login == \"github-actions[bot]\" and (.body | contains(\"we haven't heard back\")))] | last | .created_at // \"\"")

.github/workflows/triage-contributor-input-needed.yml:185

  • The closing comment body also has leading indentation before "If you'd like to continue…", which will render as a code block in Markdown. Remove the indentation from the multi-line string (or build the body via heredoc/printf) to keep formatting consistent.
                gh pr comment "$PR_NUM" --body "Closing this PR due to inactivity. Thank you for your contribution, @$PR_AUTHOR!

          If you'd like to continue working on this, feel free to reopen the PR and we'll be happy to review it again."
                gh pr close "$PR_NUM"

README.md:24

  • This workflow’s behavior expects pull_request_target: [labeled, synchronize] (it has a job gated on github.event.action == 'labeled'), but the README trigger summary only mentions pull_request_target: [synchronize]. Update the trigger description to include labeled so adopters wire it correctly.
| [`triage-contributor-input-needed.yml`](.github/workflows/triage-contributor-input-needed.yml) | Auto-labels PRs with changes requested, warns after inactivity, auto-closes | `pull_request_target: [synchronize]` + `issue_comment` + `schedule` |

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +169 to +173
if [[ "$LABEL_ADDED" < "$WARN_CUTOFF" ]]; then
gh pr comment "$PR_NUM" --body "Hey @$PR_AUTHOR 👋 — we haven't heard back from you on the requested changes. If you're still working on this, please let us know by pushing updated commits or leaving a comment.

This PR will be automatically closed in **$CLOSE_DAYS days** if there is no further activity."
fi
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warning comment body includes lines with significant leading indentation (e.g. the "This PR will be automatically closed…" line). In GitHub-flavored Markdown, 4+ leading spaces render as a code block, so the message formatting will be off. Construct the multi-line body without leading indentation (heredoc/printf) so it renders as intended.

This issue also appears on line 182 of the same file.

Copilot uses AI. Check for mistakes.
tidy-dev and others added 3 commits February 18, 2026 12:16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
env:
LABELS: ${{ inputs.triage_label || 'needs-triage' }}

- name: Add acknowledging comment
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While testing the other workflow, I found this comment a bit over the board and making the PR history unnecessarily noisy.

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