debug labeler #5
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
name: "Pull Request Labeler" | |
on: | |
- pull_request_target | |
- push | |
jobs: | |
labeler: | |
permissions: | |
contents: read | |
pull-requests: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Ensure labels exist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
labels=( | |
'{"name":"🚨action","description":"ChangesinGitHubworkflowsoractions","color":"A75AD5"}' | |
'{"name":"🤖 bot","description":"Automatically generated pull request","color":"0075CA"}' | |
'{"name":"🐛 bug","description":"Something isn't working","color":"D73A4A"}' | |
'{"name":"📝 changeset","description":"Contains changeset files","color":"304EF9"}' | |
'{"name":"🚧 config","description":"Configuration file updates","color":"C0ED4F"}' | |
'{"name":"✒️ documentation","description":"Documentation updates, like README changes","color":"66741D"}' | |
'{"name":"⏫ enhancement","description":"New feature or request","color":"3C11FD"}' | |
'{"name":"🌏 i18n","description":"Updates to internationalized docs, excluding English","color":"006B75"}' | |
'{"name":"🚀 manifest","description":"Manifest-related changes","color":"96D3D7"}' | |
'{"name":"📦 package","description":"Updates in package structure or package.json","color":"F34A37"}' | |
'{"name":"🏯 styles","description":"Stylesheets or design updates","color":"550F5A"}' | |
) | |
echo "${labels[@]}" | |
for label in "${labels[@]}"; do | |
name=$(echo "$label" | jq -r .name) | |
description=$(echo "$label" | jq -r .description) | |
color=$(echo "$label" | jq -r .color) | |
if ! gh label list | grep -q "$name"; then | |
gh label create "$name" --description "$description" --color "$color" | |
fi | |
done | |
- uses: actions/labeler@v5 | |
with: | |
configuration-path: .github/labeler.yaml | |
sync-labels: true |