Skip to content

feat: join and leave msg toasts #7

feat: join and leave msg toasts

feat: join and leave msg toasts #7

Workflow file for this run

name: Semantic Autolabel
on:
pull_request:
types: [opened, edited]
permissions:
pull-requests: write
env:
TYPES: breaking,feat,fix,content,docs
jobs:
autolabel:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get semantic type
id: sem_type
run: |
SEMTYPE=$(sed -E 's/^([a-z]+)(\([A-Za-z0-9_\-]+\))?(!?):.*/\1/g' <<< "$PR_TITLE")
echo "SEMTYPE=$SEMTYPE" >> "$GITHUB_OUTPUT"
env:
PR_TITLE: ${{ github.event.pull_request.title }}
- name: Get breaking
id: breaking
run: |
BREAKING=$(sed -E 's/^([a-z]+)(\([A-Za-z0-9_\-]+\))?(!?):.*/\3/g' <<< "$PR_TITLE")
if [[ "$BREAKING" == '!' ]]; then
echo "BREAKING=true" >> "$GITHUB_OUTPUT"
fi
env:
PR_TITLE: ${{ github.event.pull_request.title }}
- name: Apply label
run: |
gh pr edit ${{ github.event.pull_request.number }} --remove-label $TYPES || true
if [ -n "$BREAKING" ]; then
gh pr edit ${{ github.event.pull_request.number }} --add-label "breaking" || true
elif [ -n "$SEMTYPE" ]; then
gh pr edit ${{ github.event.pull_request.number }} --add-label "$SEMTYPE" || true
else
echo "No semantic type found in PR title."
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEMTYPE: ${{ steps.sem_type.outputs.SEMTYPE }}
BREAKING: ${{ steps.breaking.outputs.BREAKING }}