Skip to content

Commit

Permalink
Merge pull request #290 from PHPCSStandards/feature/ghactions-auto-re…
Browse files Browse the repository at this point in the history
…move-some-labels

GH Actions: automate some label management
  • Loading branch information
jrfnl authored Nov 14, 2023
2 parents 89d7f55 + cb45669 commit c67c182
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/label-remove-outdated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Remove outdated labels

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

jobs:
on-issue-close:
runs-on: ubuntu-latest
if: github.repository_owner == 'PHPCSStandards' && 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: wait for upstream
on-pr-merge:
runs-on: ubuntu-latest
if: github.repository_owner == 'PHPCSStandards' && 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: wait for upstream
on-pr-close:
runs-on: ubuntu-latest
if: github.repository_owner == 'PHPCSStandards' && 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: wait for upstream

0 comments on commit c67c182

Please sign in to comment.