summaryrefslogtreecommitdiffstats
path: root/.github/workflows/issue-triage.yml
blob: d80addfbceab9486d43e6d3bf5bb9fac7f4924ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# This workflow assists with initial triage of new issues by applying labels
# based on data provided in the issue.
#
# Configuration file that maps issue form input values to labels:
#   advanced-issue-labeler.yml
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
# For more information, see:
# https://github.com/stefanbuck/github-issue-parser
# https://github.com/redhat-plumbers-in-action/advanced-issue-labeler

name: Issue Triage Workflow

on:
  issues:
    types: [ opened ]

jobs:
  triage_issue:
    name: Triage Issue
    runs-on: ubuntu-latest

    strategy:
      matrix:
        template: [ bug_report.yml, documentation_request.yml, feature_request.yml ]

    permissions:
      issues: write

    steps:
      - uses: actions/checkout@v4

      - name: Parse Issue Form
        uses: stefanbuck/github-issue-parser@v3
        id: issue-parser
        with:
          issue-body: ${{ github.event.issue.body }}
          template-path: .github/ISSUE_TEMPLATE/${{ matrix.template }}

      - name: Apply Labels from Triage
        uses: redhat-plumbers-in-action/advanced-issue-labeler@v3
        with:
          issue-form: ${{ steps.issue-parser.outputs.jsonString }}
          template: ${{ matrix.template }}
          token: ${{ secrets.GITHUB_TOKEN }}

      - name: Update Assignee
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          FIX_OWNER: ${{ steps.issue-parser.outputs.issueparser_fix_owner }}
        run: |
          if [[ $FIX_OWNER == "I will fix it" ]] || [[ $FIX_OWNER == "I will make the change" ]] || [[ $FIX_OWNER == "I will implement the feature" ]]
          then
            gh issue edit ${{ github.event.issue.html_url }} --add-assignee ${{ github.event.issue.user.login }}
          fi