-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[repo] Automatically add area labels when new issue is opened (#5601)
- Loading branch information
1 parent
abb6801
commit ee5e1e0
Showing
5 changed files
with
44 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: 'Add labels for area found in bug issue descriptions' | ||
on: | ||
issues: | ||
types: [opened] | ||
|
||
permissions: | ||
issues: write | ||
|
||
jobs: | ||
add-labels: | ||
if: ${{ !github.event.issue.pull_request }} | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: check out code | ||
uses: actions/checkout@v4 | ||
|
||
- 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 | ||
env: | ||
GH_TOKEN: ${{ github.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters