Migrate PR triage workflows to shared workflows#12707
Migrate PR triage workflows to shared workflows#12707
Conversation
Replace prauto.yml and pr-help-wanted.yml with a single triage-pull-requests.yml that calls shared reusable workflows from desktop/gh-cli-and-desktop-shared-workflows: - triage-label-external-pr: labels external PRs with external,needs-triage - triage-close-from-default-branch: closes PRs opened from trunk - triage-pr-requirements: enforces body length + help-wanted issue linkage - triage-close-no-help-wanted: closes PRs labeled no-help-wanted-issue - triage-ready-for-review: removes needs-triage on ready-for-review label Also adds a daily schedule to auto-close PRs with unmet requirements after 7 days. Deletes: - prauto.yml - pr-help-wanted.yml - scripts/check-help-wanted.sh Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Migrates pull request triage automation from repo-local workflows/scripts to reusable workflows in desktop/gh-cli-and-desktop-shared-workflows, consolidating PR triage behaviors into a single workflow.
Changes:
- Add a new consolidated PR triage workflow (
triage-pull-requests.yml) that calls shared reusable workflows for labeling/closing/checking PRs and a daily scheduled task. - Remove legacy PR automation workflows (
prauto.yml,pr-help-wanted.yml) and the now-unused helper script (check-help-wanted.sh).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/triage-pull-requests.yml |
New consolidated workflow wiring PR triage events + schedule to shared reusable workflows. |
.github/workflows/scripts/check-help-wanted.sh |
Removed obsolete script (help-wanted linkage checks) now handled via shared workflow. |
.github/workflows/prauto.yml |
Deleted legacy PR automation workflow replaced by shared workflows. |
.github/workflows/pr-help-wanted.yml |
Deleted legacy workflow replaced by shared PR requirements workflow. |
Comments suppressed due to low confidence (1)
.github/workflows/triage-pull-requests.yml:37
triage-pr-requirementsis described as applying anunmet-requirementslabel and possibly commenting/closing PRs. Those actions typically requireissues: writeon the caller workflow token; withissues: readhere the reusable workflow may fail to apply labels/comments. Consider changing this job's permissions toissues: write(write includes read).
permissions:
issues: read
pull-requests: write
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| issues: read | ||
| pull-requests: write | ||
|
|
||
| close-unmet-requirements: | ||
| if: github.event_name == 'schedule' | ||
| uses: desktop/gh-cli-and-desktop-shared-workflows/.github/workflows/triage-pr-requirements.yml@main | ||
| permissions: | ||
| issues: read |
There was a problem hiding this comment.
Same as above for the scheduled run: if triage-pr-requirements needs to add/remove labels or leave comments when closing PRs, issues: read may be insufficient. Consider granting issues: write for this job too.
This issue also appears on line 34 of the same file.
| issues: read | |
| pull-requests: write | |
| close-unmet-requirements: | |
| if: github.event_name == 'schedule' | |
| uses: desktop/gh-cli-and-desktop-shared-workflows/.github/workflows/triage-pr-requirements.yml@main | |
| permissions: | |
| issues: read | |
| issues: write | |
| pull-requests: write | |
| close-unmet-requirements: | |
| if: github.event_name == 'schedule' | |
| uses: desktop/gh-cli-and-desktop-shared-workflows/.github/workflows/triage-pr-requirements.yml@main | |
| permissions: | |
| issues: write |
| check-requirements: | ||
| if: >- | ||
| github.event_name == 'pull_request_target' && | ||
| (github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'edited') | ||
| uses: desktop/gh-cli-and-desktop-shared-workflows/.github/workflows/triage-pr-requirements.yml@main |
There was a problem hiding this comment.
pull_request_target includes ready_for_review, but none of the jobs run when github.event.action == 'ready_for_review'. This means draft PRs that become ready may never get external labeling / default-branch closing / requirement checks. Consider including ready_for_review in the relevant job if: conditions (or adding a dedicated job for that action).
Follows up on #12677 by migrating the PR triage workflows (
prauto.yml,pr-help-wanted.yml) to shared reusable workflows.Changes
New
triage-pull-requests.yml— single workflow calling shared workflows for:external,needs-triage)trunkno-help-wanted-issueDeleted
prauto.yml— replaced by shared workflowspr-help-wanted.yml— replaced bytriage-pr-requirements.ymlscripts/check-help-wanted.sh— no longer neededBehavioral changes
needs-triage(previously onlyexternal)unmet-requirementslabel and 7-day grace period instead of immediate close