Skip to content

Commit

Permalink
Merge pull request #119 from yardasol/auto-labels
Browse files Browse the repository at this point in the history
Auto-remove labels
  • Loading branch information
abachma2 authored Feb 11, 2022
2 parents 498effa + 7c23fd6 commit bd4c9e4
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/auto-labels.yml
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 }}

0 comments on commit bd4c9e4

Please sign in to comment.