]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Automatically add "Approved" to maintainer PRs (#33337)
authorSaphire Lattice <lattice@saphi.re>
Wed, 20 Nov 2024 01:03:52 +0000 (08:03 +0700)
committerGitHub <noreply@github.com>
Wed, 20 Nov 2024 01:03:52 +0000 (12:03 +1100)
* Add an Approved labeler for maintainer PRs

* Be extra safe with conditions

.github/workflows/labeler-review.yml [new file with mode: 0644]

diff --git a/.github/workflows/labeler-review.yml b/.github/workflows/labeler-review.yml
new file mode 100644 (file)
index 0000000..79be86a
--- /dev/null
@@ -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"
\ No newline at end of file