Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 26 additions & 6 deletions .github/workflows/issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: Issue Triage
on:
issues:
types: [opened, typed]
workflow_dispatch:
inputs:
issue_number:
description: Issue number to triage
required: true
type: string

permissions:
contents: read
Expand All @@ -12,7 +18,8 @@ permissions:
concurrency:
group: >-
issue-triage-${{ github.repository }}-${{
github.event.issue.type.name == 'Bug' && github.event.issue.number
github.event_name == 'workflow_dispatch' && inputs.issue_number
|| github.event.issue.type.name == 'Bug' && github.event.issue.number
|| github.run_id
}}
cancel-in-progress: true
Expand All @@ -26,7 +33,11 @@ env:
jobs:
team_check:
runs-on: ubuntu-latest
if: ${{ github.event.issue.type.name == 'Bug' }}
if: >-
${{
github.event_name == 'workflow_dispatch'
|| github.event.issue.type.name == 'Bug'
}}
outputs:
is_team_member: ${{ steps.check.outputs.is_team_member }}
issue_number: ${{ steps.issue.outputs.issue_number }}
Expand All @@ -36,14 +47,18 @@ jobs:
id: issue
shell: bash
env:
ISSUE_NUMBER_EVENT: ${{ github.event.issue.number }}
ISSUE_NUMBER: >-
${{
github.event_name == 'workflow_dispatch' && inputs.issue_number
|| github.event.issue.number
}}
run: |
set -euo pipefail

issue_number="${ISSUE_NUMBER_EVENT}"
issue_number="${ISSUE_NUMBER}"

if [[ ! "$issue_number" =~ ^[1-9][0-9]*$ ]]; then
echo "Could not determine issue number from event payload." >&2
echo "Could not determine issue number from event payload or manual input." >&2
exit 1
fi

Expand All @@ -58,6 +73,7 @@ jobs:
persist-credentials: false

- name: Check issue author team membership
if: ${{ github.event_name != 'workflow_dispatch' }}
id: check
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
env:
Expand All @@ -84,7 +100,11 @@ jobs:
triage:
runs-on: ubuntu-latest
needs: team_check
if: ${{ needs.team_check.outputs.is_team_member == 'false' }}
if: >-
${{
github.event_name == 'workflow_dispatch'
|| needs.team_check.outputs.is_team_member == 'false'
}}
environment: integration
timeout-minutes: 60

Expand Down
Loading