File: issue-regression-labeler.yml

package info (click to toggle)
aws-crt-python 0.28.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 78,428 kB
  • sloc: ansic: 437,955; python: 27,657; makefile: 5,855; sh: 4,289; ruby: 208; java: 82; perl: 73; cpp: 25; xml: 11
file content (32 lines) | stat: -rw-r--r-- 1,199 bytes parent folder | download | duplicates (24)
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
# Apply potential regression label on issues
name: issue-regression-label
on:
  issues:
    types: [opened, edited]
jobs:
  add-regression-label:
    runs-on: ubuntu-latest
    permissions:
      issues: write
    steps:
    - name: Fetch template body
      id: check_regression
      uses: actions/github-script@v7
      env: 
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        TEMPLATE_BODY: ${{ github.event.issue.body }}
      with:
        script: |
          const regressionPattern = /\[x\] Select this option if this issue appears to be a regression\./i;
          const template = `${process.env.TEMPLATE_BODY}`
          const match = regressionPattern.test(template);
          core.setOutput('is_regression', match);
    - name: Manage regression label
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      run: |
        if [ "${{ steps.check_regression.outputs.is_regression }}" == "true" ]; then
          gh issue edit ${{ github.event.issue.number }} --add-label "potential-regression" -R ${{ github.repository }}
        else
          gh issue edit ${{ github.event.issue.number }} --remove-label "potential-regression" -R ${{ github.repository }}
        fi