-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add label-pr action --story=119540612
- Loading branch information
1 parent
5e80c3c
commit 8b5a8e6
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
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
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 }} |