Debian Codegraph @

.github/workflows/issue-regression-labeler.yml

raw symbols SCIP
1 # Apply potential regression label on issues
2 name: issue-regression-label
3 on:
4 issues:
5 types: [opened, edited]
6 jobs:
7 add-regression-label:
8 runs-on: ubuntu-latest
9 permissions:
10 issues: write
11 steps:
12 - name: Fetch template body
13 id: check_regression
14 uses: actions/github-script@v7
15 env:
16 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 TEMPLATE_BODY: ${{ github.event.issue.body }}
18 with:
19 script: |
20 const regressionPattern = /\[x\] Select this option if this issue appears to be a regression\./i;
21 const template = `${process.env.TEMPLATE_BODY}`
22 const match = regressionPattern.test(template);
23 core.setOutput('is_regression', match);
24 - name: Manage regression label
25 env:
26 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 IS_REGRESSION: ${{ steps.check_regression.outputs.is_regression }}
28 ISSUE_NUMBER: ${{ github.event.issue.number }}
29 REPO: ${{ github.repository }}
30 run: |
31 if [ "$IS_REGRESSION" == "true" ]; then
32 gh issue edit "$ISSUE_NUMBER" --add-label "potential-regression" -R "$REPO"
33 else
34 gh issue edit "$ISSUE_NUMBER" --remove-label "potential-regression" -R "$REPO"
35 fi