luminate-old/.forgejo/workflows/pr-labeler.yml
Brendan Szymanski bb28ae790a
All checks were successful
PR Checks / lint (pull_request) Successful in 59s
PR Checks / flatpak-build (pull_request) Successful in 13m21s
Remove tests
2026-06-22 13:23:31 -04:00

34 lines
1.2 KiB
YAML

name: PR Labeler
on:
pull_request_target:
types: [opened]
jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Label by branch prefix
env:
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
run: |
BRANCH="${{ forge.head_ref }}"
case "$BRANCH" in
feature/*) LABEL="enhancement/feature" ;;
fix/*) LABEL="bug" ;;
chore/*) LABEL="enhancement/chore" ;;
refactor/*) LABEL="enhancement/refactor" ;;
docs/*) LABEL="enhancement/docs" ;;
test/*) LABEL="enhancement/test" ;;
perf/*) LABEL="enhancement/perf" ;;
style/*) LABEL="enhancement/style" ;;
*) exit 0 ;;
esac
REPO="${{ forge.repository }}"
API_URL="${{ forge.api_url }}"
PR_NUMBER="${{ forge.event.number }}"
curl -s -X POST \
-H "Authorization: token $FORGEJO_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"labels\": [\"$LABEL\"]}" \
"$API_URL/repos/$REPO/issues/$PR_NUMBER/labels"