Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH Actions: automate some label management #311

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/manage-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
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 == 'Yoast' && 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: blocked
Status: needs investigation
Status: wait for upstream/PHPCSExtra
Status: wait for upstream/Slevomat
Status: wait for upstream/VIPCS
Status: wait for upstream/WordPressCS

on-pr-close:
runs-on: ubuntu-latest
if: github.repository_owner == 'Yoast' && 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: blocked
Status: needs investigation
Status: wait for upstream/PHPCSExtra
Status: wait for upstream/Slevomat
Status: wait for upstream/VIPCS
Status: wait for upstream/WordPressCS

on-issue-close:
runs-on: ubuntu-latest
if: github.repository_owner == 'Yoast' && 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: blocked
Status: needs investigation
Status: wait for upstream/PHPCSExtra
Status: wait for upstream/Slevomat
Status: wait for upstream/VIPCS
Status: wait for upstream/WordPressCS