-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from yardasol/auto-labels
Auto-remove labels
- Loading branch information
Showing
1 changed file
with
45 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,45 @@ | ||
name: Auto add and remove labels | ||
|
||
on: | ||
issues: | ||
types: [closed] | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
# job for issue events | ||
auto-labels-issues: | ||
if: ${{ !github.event.issue.pull_request }} | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Remove Priority and Status labels | ||
run: | | ||
id=${{ github.event.issue.number }} | ||
gh issue edit $id --remove-label "Priority:*" | ||
gh issue edit $id --remove-label "Status:*" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
||
# job for pr events | ||
auto-labels-pr: | ||
if: ${{ github.event.issue.pull_reqeust }} | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Remove Priority and Status labels | ||
run: | | ||
id=${{ github.event.pull_reqeust.number }} | ||
gh pr edit $id --remove-label "Priority:*" | ||
gh pr edit $id --remove-label "Status:*" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |