Skip to content

Commit

Permalink
Merge pull request #2127 from WordPress/feature/ghactions-automate-la…
Browse files Browse the repository at this point in the history
…bel-removal
  • Loading branch information
GaryJones authored Dec 7, 2022
2 parents eddec93 + 1c6dd3d commit 1e57c46
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/manage-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Remove outdated labels

on:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
pull_request_target:
types:
- closed
issues:
types:
- closed

jobs:
on-pr-merge:
runs-on: ubuntu-latest
if: github.repository_owner == 'WordPress' && github.event.pull_request.merged == true

name: Clean up labels on PR merge

steps:
- uses: mondeja/remove-labels-gh-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
"Status: Awaiting Feedback"
"Status: Review Ready"
on-pr-close:
runs-on: ubuntu-latest
if: github.repository_owner == 'WordPress' && github.event_name == 'pull_request_target' && github.event.pull_request.merged == false

name: Clean up labels on PR close

steps:
- uses: mondeja/remove-labels-gh-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
"Status: Awaiting Feedback"
"Status: close candidate"
"Status: Review Ready"
on-issue-close:
runs-on: ubuntu-latest
if: github.repository_owner == 'WordPress' && github.event.issue.state == 'closed'

name: Clean up labels on issue close

steps:
- uses: mondeja/remove-labels-gh-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
"Status: Awaiting Feedback"
"Status: close candidate"
"Status: help wanted"
"Status: good first issue"
"Status: PR Exists"

0 comments on commit 1e57c46

Please sign in to comment.