Automatically add "Approved" to maintainer PRs (#33337)

* Add an Approved labeler for maintainer PRs

* Be extra safe with conditions
This commit is contained in:
Saphire Lattice
2024-11-20 08:03:52 +07:00
committed by GitHub
parent ed1ae96fa2
commit eebf06d9d6

23
.github/workflows/labeler-review.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: "Labels: Approved"
on:
pull_request_review:
types: [submitted]
jobs:
add_label:
# Change the repository name after you've made sure the team name is correct for your fork!
if: ${{ (github.repository == 'space-wizards/space-station-14') && (github.event.review.state == 'APPROVED') }}
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: tspascoal/get-user-teams-membership@v3
id: checkUserMember
with:
username: ${{ github.actor }}
team: "content-maintainers,junior-maintainers" # CHANGE TEAM NAME HERE PLEASE <------
GITHUB_TOKEN: ${{ secrets.PAT }}
- if: ${{ steps.checkUserMember.outputs.isTeamMember == 'true' }}
uses: actions-ecosystem/action-add-labels@v1
with:
labels: "PR: Approved"