|
| 1 | +name: issue-labeler |
| 2 | + |
| 3 | +on: |
| 4 | + issues: |
| 5 | + types: [opened] |
| 6 | + |
| 7 | +jobs: |
| 8 | + labeler: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + |
| 11 | + permissions: |
| 12 | + contents: read |
| 13 | + issues: write |
| 14 | + |
| 15 | + steps: |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@v5 |
| 18 | + |
| 19 | + - name: Parse bug report issue form |
| 20 | + if: contains(github.event.issue.labels.*.name, 'bug') |
| 21 | + uses: stefanbuck/github-issue-parser@v3 |
| 22 | + id: issue-parser-bug |
| 23 | + with: |
| 24 | + template-path: .github/ISSUE_TEMPLATE/bug-report.yml |
| 25 | + |
| 26 | + - name: Parse feature request issue form |
| 27 | + if: contains(github.event.issue.labels.*.name, 'enhancement') |
| 28 | + uses: stefanbuck/github-issue-parser@v3 |
| 29 | + id: issue-parser-feature |
| 30 | + with: |
| 31 | + template-path: .github/ISSUE_TEMPLATE/feature-request.yml |
| 32 | + |
| 33 | + - name: Parse question issue form |
| 34 | + if: contains(github.event.issue.labels.*.name, 'question') |
| 35 | + uses: stefanbuck/github-issue-parser@v3 |
| 36 | + id: issue-parser-question |
| 37 | + with: |
| 38 | + template-path: .github/ISSUE_TEMPLATE/question.yml |
| 39 | + |
| 40 | + - name: Set labels for bug report |
| 41 | + if: contains(github.event.issue.labels.*.name, 'bug') |
| 42 | + uses: redhat-plumbers-in-action/advanced-issue-labeler@v3 |
| 43 | + with: |
| 44 | + issue-form: ${{ steps.issue-parser-bug.outputs.jsonString }} |
| 45 | + template: bug-report.yml |
| 46 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 47 | + |
| 48 | + - name: Set labels for feature request |
| 49 | + if: contains(github.event.issue.labels.*.name, 'enhancement') |
| 50 | + uses: redhat-plumbers-in-action/advanced-issue-labeler@v3 |
| 51 | + with: |
| 52 | + issue-form: ${{ steps.issue-parser-feature.outputs.jsonString }} |
| 53 | + template: feature-request.yml |
| 54 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 55 | + |
| 56 | + - name: Set labels for question |
| 57 | + if: contains(github.event.issue.labels.*.name, 'question') |
| 58 | + uses: redhat-plumbers-in-action/advanced-issue-labeler@v3 |
| 59 | + with: |
| 60 | + issue-form: ${{ steps.issue-parser-question.outputs.jsonString }} |
| 61 | + template: question.yml |
| 62 | + token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments