Skip to content

Commit

Permalink
feat: add label-pr action --story=119540612
Browse files Browse the repository at this point in the history
  • Loading branch information
normal-wls committed Sep 6, 2024
1 parent 5e80c3c commit 8b5a8e6
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/label-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Label PR based on title"

on:
pull_request:
types: [opened, edited, reopened, synchronize]

jobs:
label-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Label PR
run: |
PR_TITLE="${{ github.event.pull_request.title }}"
if [[ "$PR_TITLE" == "fix:"* ]]; then
gh pr edit ${{ github.event.pull_request.number }} --add-label bugfix
elif [[ "$PR_TITLE" == "feat:"* ]]; then
gh pr edit ${{ github.event.pull_request.number }} --add-label feature
else
echo "No label with this title: $PR_TITLE"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 8b5a8e6

Please sign in to comment.