Skip to content

Commit

Permalink
[repo] Add-labels workflow fix (#5605)
Browse files Browse the repository at this point in the history
Co-authored-by: Reiley Yang <reyang@microsoft.com>
  • Loading branch information
CodeBlanch and reyang committed May 10, 2024
1 parent b8ea807 commit 409d96d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/add-labels.yml
Expand Up @@ -18,13 +18,8 @@ jobs:
- name: Add labels for areas found in bug issue descriptions
shell: pwsh
run: |
$match = [regex]::Match('${{ github.event.issue.body }}', '^[#]+ Area\s*?(area:\w+)')
if ($match.Success -eq $false)
{
Return
}
gh issue edit ${{ github.event.issue.number }} `
--add-label $match.Groups[1].Value
.\build\scripts\add-labels.ps1 -issueNumber $env:ISSUE_NUMBER -issueBody $env:ISSUE_BODY
env:
GH_TOKEN: ${{ github.token }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
ISSUE_BODY: ${{ github.event.issue.body }}
6 changes: 6 additions & 0 deletions OpenTelemetry.sln
Expand Up @@ -338,6 +338,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TagWriter", "TagWriter", "{
src\Shared\TagWriter\TagWriter.cs = src\Shared\TagWriter\TagWriter.cs
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{44982E0D-C8C6-42DC-9F8F-714981F27CE6}"
ProjectSection(SolutionItems) = preProject
build\scripts\add-labels.ps1 = build\scripts\add-labels.ps1
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -649,6 +654,7 @@ Global
{19545B37-8518-4BDD-AD49-00C031FB3C2A} = {3862190B-E2C5-418E-AFDC-DB281FB5C705}
{87A20A76-D524-4AAC-AF92-8725BFED0415} = {A49299FB-C5CD-4E0E-B7E1-B7867BBD67CC}
{993E65E5-E71B-40FD-871C-60A9EBD59724} = {A49299FB-C5CD-4E0E-B7E1-B7867BBD67CC}
{44982E0D-C8C6-42DC-9F8F-714981F27CE6} = {7CB2F02E-03FA-4FFF-89A5-C51F107623FD}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {55639B5C-0770-4A22-AB56-859604650521}
Expand Down
12 changes: 12 additions & 0 deletions build/scripts/add-labels.ps1
@@ -0,0 +1,12 @@
param(
[Parameter(Mandatory=$true)][int]$issueNumber,
[Parameter(Mandatory=$true)][string]$issueBody
)

$match = [regex]::Match($issueBody, '^[#]+ Area\s*?(area:\w+)')
if ($match.Success -eq $false)
{
Return
}

gh issue edit $issueNumber --add-label $match.Groups[1].Value

0 comments on commit 409d96d

Please sign in to comment.