WordPress-Coding-Standards/.github/workflows/manage-labels.yml
jrfnl 1f16cb62a7
GH Actions: improve "don't run on forks" conditions
Remove the conditions containing a hard-coded repository name in favour of a more generic condition which should safeguard that select steps don't run on forks just the same.
2025-11-23 14:50:19 +01:00

56 lines
1.6 KiB
YAML

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.event.repository.fork == false && github.event.pull_request.merged == true
name: Clean up labels on PR merge
steps:
- uses: mondeja/remove-labels-gh-action@b7118e4ba5dca74acf1059b3cb7660378ff9ab1a # v2.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
Status: Awaiting feedback
Status: Review ready
on-pr-close:
runs-on: ubuntu-latest
if: github.event.repository.fork == false && 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@b7118e4ba5dca74acf1059b3cb7660378ff9ab1a # v2.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
Status: Awaiting feedback
Status: Close candidate
Status: Review ready
on-issue-close:
runs-on: ubuntu-latest
if: github.event.repository.fork == false && github.event.issue.state == 'closed'
name: Clean up labels on issue close
steps:
- uses: mondeja/remove-labels-gh-action@b7118e4ba5dca74acf1059b3cb7660378ff9ab1a # v2.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
Status: Awaiting feedback
Status: Close candidate
Status: Good first issue
Status: Help wanted