Skip to content

Commit 4e9ece3

Browse files
bhavya2109sharmaashishdhingra
authored andcommitted
chore: Modified bug issue template to add checkbox to report potential regression.
1 parent 09f0452 commit 4e9ece3

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.github/ISSUE_TEMPLATE/bug-report.yml

+11
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ body:
2222
description: What is the problem? A clear and concise description of the bug.
2323
validations:
2424
required: true
25+
26+
- type: checkboxes
27+
id: regression
28+
attributes:
29+
label: Regression Issue
30+
description: What is a regression? If it worked in a previous version but doesn't in the latest version, it's considered a
31+
regression. In this case, please provide specific version number in the report.
32+
options:
33+
- label: Select this option if this issue appears to be a regression.
34+
required: false
35+
2536
- type: textarea
2637
id: expected
2738
attributes:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
run: |
28+
if [ "${{ steps.check_regression.outputs.is_regression }}" == "true" ]; then
29+
gh issue edit ${{ github.event.issue.number }} --add-label "potential-regression" -R ${{ github.repository }}
30+
else
31+
gh issue edit ${{ github.event.issue.number }} --remove-label "potential-regression" -R ${{ github.repository }}
32+
fi

0 commit comments

Comments
 (0)