ci: Add labeler workflow (#1010)
This commit is contained in:
parent
2049601be5
commit
62af9e842f
38
.github/workflows/labeler.yml
vendored
Normal file
38
.github/workflows/labeler.yml
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
issues:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
labeler:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 5
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
steps:
|
||||||
|
- name: Label
|
||||||
|
env:
|
||||||
|
TITLE: ${{ github.event.issue.title }}${{ github.event.pull_request.title }}
|
||||||
|
BODY: ${{ github.event.issue.body }}${{ github.event.pull_request.body }}
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GH_REPO: ${{ github.repository }}
|
||||||
|
NUMBER: ${{ github.event.issue.number }}
|
||||||
|
run: |
|
||||||
|
if [[ $TITLE == *"feat:"* || $TITLE == *"feat("* ]]; then
|
||||||
|
gh issue edit "$NUMBER" --add-label "feature"
|
||||||
|
elif [[ $TITLE == *"fix:"* || $TITLE == *"fix("* ]]; then
|
||||||
|
gh issue edit "$NUMBER" --add-label "bug"
|
||||||
|
fi
|
||||||
|
if [[ $TITLE == *"alerting"* || $TITLE == *"provider"* || $TITLE == *"alert"* || $BODY == *"alerting"* || $BODY == *"provider"* || $BODY == *"alert"* ]]; then
|
||||||
|
gh issue edit "$NUMBER" --add-label "area/alerting"
|
||||||
|
fi
|
||||||
|
if [[ $TITLE == *"security"* || $TITLE == *"oidc"* || $TITLE == *"oauth2"* || $BODY == *"security"* || $BODY == *"oidc"* || $BODY == *"oauth2"* ]]; then
|
||||||
|
gh issue edit "$NUMBER" --add-label "area/security"
|
||||||
|
fi
|
||||||
|
if [[ $TITLE == *"metric"* || $TITLE == *"prometheus"* || $BODY == *"metric"* || $BODY == *"prometheus"* ]]; then
|
||||||
|
gh issue edit "$NUMBER" --add-label "area/metrics"
|
||||||
|
fi
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user