Issue and PR Triage #66
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Issue and PR Triage | |
| 'on': | |
| issues: | |
| types: [opened] | |
| pull_request_target: | |
| types: [opened] | |
| workflow_dispatch: | |
| inputs: | |
| issue_number: | |
| description: 'Issue/PR number to triage (leave empty to process all)' | |
| required: false | |
| type: string | |
| permissions: | |
| issues: write | |
| pull-requests: write | |
| contents: read | |
| # A caller can only cap a reusable workflow's permissions, so the scope the | |
| # Copilot CLI needs has to be granted here too. `models: read` was for the | |
| # GitHub Models provider, which `actions/ai-inference` v3 removed. | |
| copilot-requests: write | |
| # A caller can only cap a reusable workflow's permissions, never raise them, | |
| # so `actions: write` has to be granted here for the dispatch job downstream | |
| # to work at all. The reusable workflow narrows it to that single job, so the | |
| # `pull_request_target` job does not receive it. Removing it here breaks | |
| # dispatching (see #271/#272); narrow it there instead. | |
| actions: write | |
| jobs: | |
| issue-triage: | |
| uses: wp-cli/.github/.github/workflows/reusable-issue-triage.yml@main | |
| with: | |
| issue_number: >- | |
| ${{ | |
| (github.event_name == 'workflow_dispatch' && inputs.issue_number) || | |
| (github.event_name == 'pull_request_target' && github.event.pull_request.number) || | |
| (github.event_name == 'issues' && github.event.issue.number) || | |
| '' | |
| }} |