.github/workflows/ticket-check.yml

40 lines · 1723 bytes

 1# Checks newly opened issues contain enough info, and follow the required format
 2name: 🎫 Issue Validator
 3on:
 4  issues:
 5    types: [opened, edited]
 6jobs:
 7  check-title:
 8    runs-on: ubuntu-latest
 9    permissions: write-all
10    steps:
11      - name: Check Default Title
12        if: "endsWith(github.event.issue.title, '<title>')"
13        uses: peter-evans/create-or-update-comment@v2
14        with:
15          token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
16          issue-number: ${{ github.event.issue.number }}
17          body: |
18            Please ensure that your ticket has an appropriate title
19      - name: Check Title Contains Categroy
20        if: "!(startsWith(github.event.issue.title, '[') && contains(github.event.issue.title, ']'))"
21        uses: peter-evans/create-or-update-comment@v2
22        with:
23          token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
24          issue-number: ${{ github.event.issue.number }}
25          body: |
26            Please ensure that your ticket's title is preceded with a category.
27            For example, `[ADDITION]`, `[AMENDMENT]`, `[REMOVAL]` or `[QUESTION]`.
28      - name: Check Quality Checklist
29        if: "contains(github.event.issue.body, '[ ]') || !(contains(github.event.issue.body, '[X]') || contains(github.event.issue.body, '[x]'))"
30        uses: peter-evans/create-or-update-comment@v2
31        with:
32          token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
33          issue-number: ${{ github.event.issue.number }}
34          body: |
35            Please ensure that you've followed the issue template fully.
36            It's important that you complete the quality & transparency checklist.
37
38
39            
40