Skip to content

Commit ee5e1e0

Browse files
authored
[repo] Automatically add area labels when new issue is opened (#5601)
1 parent abb6801 commit ee5e1e0

File tree

5 files changed

+44
-12
lines changed

5 files changed

+44
-12
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml renamed to .github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ body:
55
- type: markdown
66
attributes:
77
value: |
8-
Thanks for taking the time to fill out this bug report! Please make sure to fill out the entire form below, providing as much context as you can in order to help us triage and track down your bug as quickly as possible.
8+
Thanks for taking the time to fill out this bug report! Please make sure to fill out the entire form below, providing as much context as you can in order to help us triage and track down the bug as quickly as possible.
99
10-
Before filing a bug, please be sure you have searched through [existing bugs](https://github.com/open-telemetry/opentelemetry-dotnet/issues?q=is%3Aissue+is%3Aopen+label%3Abug) to see if an existing issue covers your bug.
10+
Before filing a bug, please be sure you have searched through [existing bugs](https://github.com/open-telemetry/opentelemetry-dotnet/issues?q=is%3Aissue+is%3Aopen+label%3Abug) to see if an existing issue covers the bug.
1111
1212
- type: dropdown
1313
id: area
1414
attributes:
15-
label: Area(s)
16-
description: Which area(s) does your bug report concern? If none fits, please select `area:other`
15+
label: Area
16+
description: Which area does this bug report concern? If none fits, please select `area:other`
1717
multiple: false
1818
options:
1919
- area:other
@@ -28,7 +28,7 @@ body:
2828

2929
- type: textarea
3030
attributes:
31-
label: Package version
31+
label: Package Version
3232
description: List of [all OpenTelemetry NuGet packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are using (e.g. `OpenTelemetry 1.0.2`)
3333
value: |
3434
| Package Name | Version |
@@ -41,8 +41,8 @@ body:
4141

4242
- type: input
4343
attributes:
44-
label: Runtime version
45-
description: What .NET runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can find this information from the `*.csproj` file) did you use?
44+
label: Runtime Version
45+
description: What .NET runtime version did you use? (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can find this information from the `*.csproj` file)
4646
validations:
4747
required: true
4848

@@ -63,7 +63,7 @@ body:
6363
- type: textarea
6464
attributes:
6565
label: Expected Result
66-
description: What did you expect to see?
66+
description: What did you expect to see?
6767
validations:
6868
required: true
6969

@@ -76,5 +76,5 @@ body:
7676

7777
- type: textarea
7878
attributes:
79-
label: Additional context
79+
label: Additional Context
8080
description: Any additional information you think may be relevant to this issue.
File renamed without changes.
File renamed without changes.

.github/workflows/add-labels.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'Add labels for area found in bug issue descriptions'
2+
on:
3+
issues:
4+
types: [opened]
5+
6+
permissions:
7+
issues: write
8+
9+
jobs:
10+
add-labels:
11+
if: ${{ !github.event.issue.pull_request }}
12+
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: check out code
16+
uses: actions/checkout@v4
17+
18+
- name: Add labels for areas found in bug issue descriptions
19+
shell: pwsh
20+
run: |
21+
$match = [regex]::Match('${{ github.event.issue.body }}', '^[#]+ Area\s*?(area:\w+)')
22+
if ($match.Success -eq $false)
23+
{
24+
Return
25+
}
26+
27+
gh issue edit ${{ github.event.issue.number }} `
28+
--add-label $match.Groups[1].Value
29+
env:
30+
GH_TOKEN: ${{ github.token }}

OpenTelemetry.sln

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7CB2F02E
4141
build\OpenTelemetry.prod.ruleset = build\OpenTelemetry.prod.ruleset
4242
build\OpenTelemetry.test.ruleset = build\OpenTelemetry.test.ruleset
4343
build\RELEASING.md = build\RELEASING.md
44+
build\sanitycheck.py = build\sanitycheck.py
4445
build\stylecop.json = build\stylecop.json
4546
build\test-aot-compatibility.ps1 = build\test-aot-compatibility.ps1
4647
build\test-threadSafety.ps1 = build\test-threadSafety.ps1
@@ -82,13 +83,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{F1D0
8283
EndProject
8384
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEMPLATE", "{A533C800-3DC3-4D04-90A7-0CE7A1E6BDB3}"
8485
ProjectSection(SolutionItems) = preProject
85-
.github\ISSUE_TEMPLATE\bug_report.md = .github\ISSUE_TEMPLATE\bug_report.md
86-
.github\ISSUE_TEMPLATE\feature_request.md = .github\ISSUE_TEMPLATE\feature_request.md
87-
.github\ISSUE_TEMPLATE\question.md = .github\ISSUE_TEMPLATE\question.md
86+
.github\ISSUE_TEMPLATE\bug_report.yml = .github\ISSUE_TEMPLATE\bug_report.yml
87+
.github\ISSUE_TEMPLATE\feature_request.yml = .github\ISSUE_TEMPLATE\feature_request.yml
88+
.github\ISSUE_TEMPLATE\question.yml = .github\ISSUE_TEMPLATE\question.yml
8889
EndProjectSection
8990
EndProject
9091
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{E69578EB-B456-4062-A645-877CD964528B}"
9192
ProjectSection(SolutionItems) = preProject
93+
.github\workflows\add-labels.yml = .github\workflows\add-labels.yml
9294
.github\workflows\ci.yml = .github\workflows\ci.yml
9395
.github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml
9496
.github\workflows\Component.BuildTest.yml = .github\workflows\Component.BuildTest.yml

0 commit comments

Comments
 (0)