Migrate issue triage workflows to shared workflows#12677
Migrate issue triage workflows to shared workflows#12677
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request migrates several issue triage workflows from inline implementations to shared reusable workflows hosted in the desktop/gh-cli-and-desktop-shared-workflows repository. The migration centralizes triage automation logic to ensure consistency between cli/cli and desktop/desktop projects.
Changes:
- Replaced inline issue triage workflows with calls to 9 shared workflows for common triage operations (labeling, closing invalid/spam issues, posting comments, etc.)
- Migrated the
discusslabel workflow to use a shared implementation - Updated label references from
needs-user-inputtomore-info-neededand fromp1/p2/p3topriority-1/2/3throughout documentation and workflows - Added new scheduled workflow for auto-closing issues with no response after 14 days
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/triage-issues.yml |
New centralized workflow calling 9 shared workflows for issue triage automation |
.github/workflows/triage-scheduled-tasks.yml |
New scheduled workflow for hourly no-response auto-close |
.github/workflows/triage.yml |
Refactored to use shared triage-discuss.yml workflow |
.github/workflows/issueauto.yml |
Deleted - replaced by shared triage-label-incoming workflow |
.github/workflows/feature-request-comment.yml |
Deleted - replaced by shared triage-enhancement-comment workflow |
.github/workflows/stale-issues.yml |
Updated label reference from needs-user-input to more-info-needed |
docs/triage.md |
Updated all label references to use new naming convention |
.github/workflows/scripts/spam-detection/eval-prompts.yml |
Updated label reference in test data |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| contents: read | ||
| issues: write | ||
| pull-requests: write |
There was a problem hiding this comment.
The close-invalid job includes 'contents: read' and 'pull-requests: write' permissions, which seem unnecessary for a workflow that only closes invalid issues. Unless the shared workflow triage-close-invalid.yml performs operations on pull requests or needs to read repository contents, these permissions could be removed to follow the principle of least privilege.
| contents: read | |
| issues: write | |
| pull-requests: write | |
| issues: write |
| EOF | ||
| jobs: | ||
| discuss: | ||
| if: github.event.action == 'labeled' |
There was a problem hiding this comment.
The condition should check for the 'discuss' label specifically. The old workflow had if: github.event.action == 'labeled' && github.event.label.name == 'discuss', but the new version only checks for the labeled action. This means the workflow will trigger for ANY label addition, not just the 'discuss' label, which could cause unintended workflow runs and potentially create internal issues for unrelated labels.
| if: github.event.action == 'labeled' | |
| if: github.event.action == 'labeled' && github.event.label.name == 'discuss' |
| discuss: | ||
| if: github.event.action == 'labeled' | ||
| uses: desktop/gh-cli-and-desktop-shared-workflows/.github/workflows/triage-discuss.yml@main | ||
| with: | ||
| target_repo: 'github/cli' | ||
| cc_team: '@github/cli' | ||
| secrets: | ||
| discussion_token: ${{ secrets.CLI_DISCUSSION_TRIAGE_TOKEN }} |
There was a problem hiding this comment.
The workflow is missing the 'environment: cli-discuss-automation' configuration that was present in the old workflow. This environment is likely required to access the CLI_DISCUSSION_TRIAGE_TOKEN secret. Without it, the workflow may fail to authenticate when creating internal discussion issues.
Summary
Replaces several local issue triage workflows with calls to shared reusable workflows. This centralizes triage logic so that cli/cli and desktop/desktop use the same underlying automation, making it easier to maintain and evolve.
What changed
New workflow files
triage-issues.yml— A single workflow triggered by issue events that calls 9 shared workflows:needs-triageneeds-triagewhenmore-info-neededis removedinvalid,suspected-spam, oroff-topicenhancementis addedunable-to-reproduceis addedneeds-triagewhen end-state labels are added (e.g.priority-1,enhancement)needs-triagewhen an issue is closedtriage-scheduled-tasks.yml— Scheduled and event-driven tasks:more-info-neededwith no response for 14 daysMigrated
triage.yml— The inline discuss logic (creating internal issues ingithub/cli) has been replaced with a call to the sharedtriage-discuss.ymlworkflow. Same behavior, less code.Deleted
issueauto.yml— Replaced by the sharedtriage-label-incomingworkflow.feature-request-comment.yml— Replaced by the sharedtriage-enhancement-commentworkflow.stale-issues.yml— Replaced by the sharedtriage-stale-issuesworkflow (called fromtriage-scheduled-tasks.yml).Updated references
docs/triage.md— Updated all references to renamed labels (more-info-needed,priority-1/2/3).eval-prompts.yml— Same label rename in spam detection test data.Behavioral changes
needs-triageis now added to all new issues. Previously, issues opened by org members were skipped. The shared workflow labels everything, which is simpler and consistent with how desktop/desktop works.needs-triageon end-state labels or issue close, and no-response auto-close.needs-triageandmore-info-neededcould go stale. Now all issues (except those labeledkeep) can be marked stale after 30 days of inactivity. Custom stale/close messages are replaced withactions/staledefaults.Not migrated yet
detect-spam.ymland scripts as-is.prauto.ymlandpr-help-wanted.ymlwill be migrated in a future phase.