diff --git a/.github/workflows/labeler-dispatch.yml b/.github/workflows/labeler-dispatch.yml new file mode 100644 index 00000000000..4c9b78b3adb --- /dev/null +++ b/.github/workflows/labeler-dispatch.yml @@ -0,0 +1,12 @@ +name: "Review Trigger" + +on: + pull_request_review_comment: + types: [created, edited] + +jobs: + noop: + runs-on: ubuntu-latest + steps: + - name: Dummy step + run: echo "This is so incredibly fucking stupid" diff --git a/.github/workflows/labeler-review.yml b/.github/workflows/labeler-review.yml index 19fc130a6f3..85b784a2576 100644 --- a/.github/workflows/labeler-review.yml +++ b/.github/workflows/labeler-review.yml @@ -1,33 +1,34 @@ -# SPDX-FileCopyrightText: 2024 Myra -# SPDX-FileCopyrightText: 2024 Saphire Lattice -# SPDX-FileCopyrightText: 2024 Vasilis -# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com> -# -# SPDX-License-Identifier: AGPL-3.0-or-later - name: "Labels: Approved" on: - pull_request_review: - types: [submitted] + workflow_run: + workflows: ["Review Trigger"] + types: [completed] jobs: label-on-approval: + if: github.event.workflow_run.event == 'pull_request_review' + runs-on: ubuntu-latest + permissions: contents: read issues: write pull-requests: write - runs-on: ubuntu-latest + steps: - - name: Create JSON File - id: curling-reviews + - name: Extract PR number + id: pr run: | - PR_NUMBER=${{ github.event.pull_request.number }} - OWNER=${{ github.repository_owner }} - REPO=${{ github.event.repository.name }} - TOKEN=${{ secrets.GITHUB_TOKEN }} + PR_NUMBER=$(jq '.workflow_run.pull_requests[0].number' "$GITHUB_EVENT_PATH") + echo "pr=$PR_NUMBER" >> $GITHUB_OUTPUT - # Fetch the reviews and place them into a json file. + - name: Create JSON File + env: + TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ steps.pr.outputs.pr }} + OWNER: ${{ github.repository_owner }} + REPO: ${{ github.event.repository.name }} + run: | curl -o reviews.json -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer $TOKEN" \ @@ -37,18 +38,23 @@ jobs: - name: Check for Approvals id: check-approvals run: | - # Count the number of approvals - APPROVALS=$(jq '[.[] | select(.state=="APPROVED")] | length' reviews.json) + APPROVALS=$(jq ' + group_by(.user.login) + | map(last) + | map(select(.state=="APPROVED")) + | length + ' reviews.json) echo "Number of approvals: $APPROVALS" - echo "::set-output name=approvals::$APPROVALS" - + echo "approvals=$APPROVALS" >> $GITHUB_OUTPUT + - name: Add Approved Label if Enough Approvals - if: steps.check-approvals.outputs.approvals >= 2 # Change the threshold here + if: steps.check-approvals.outputs.approvals >= 2 uses: actions-ecosystem/action-add-labels@v1 env: github_token: ${{ secrets.GITHUB_TOKEN }} with: + number: ${{ steps.pr.outputs.pr }} labels: "S: Approved" - name: Remove Other Labels on Approved @@ -57,6 +63,7 @@ jobs: env: github_token: ${{ secrets.GITHUB_TOKEN }} with: + number: ${{ steps.pr.outputs.pr }} labels: | "S: Needs Review" "S: Needs Second Approval" @@ -67,24 +74,27 @@ jobs: env: github_token: ${{ secrets.GITHUB_TOKEN }} with: + number: ${{ steps.pr.outputs.pr }} labels: | "S: Needs Second Approval" "S: Needs Review" - - name: Remove Other Labels on Second Approval Requirement + - name: Remove Other Labels on Second Approval if: steps.check-approvals.outputs.approvals == 1 uses: actions-ecosystem/action-remove-labels@v1 env: github_token: ${{ secrets.GITHUB_TOKEN }} with: + number: ${{ steps.pr.outputs.pr }} labels: "S: Approved" - - name: Remove All Other Labels if No Approval + - name: Remove Other Labels if No Approval if: steps.check-approvals.outputs.approvals < 1 uses: actions-ecosystem/action-remove-labels@v1 env: github_token: ${{ secrets.GITHUB_TOKEN }} with: + number: ${{ steps.pr.outputs.pr }} labels: | "S: Approved" "S: Needs Second Approval" diff --git a/README.md b/README.md index 84cd3db0d96..393198c83c7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@

Space Station 14

+you + This is a fork from [Goob Station](https://github.com/Goob-Station/Goob-Station), a primary fork from [Space Station 14](https://github.com/space-wizards/space-station-14). To prevent people forking [Robust Toolbox](https://github.com/space-wizards/RobustToolbox), a "content" pack is loaded by the client and server. This content pack contains everything needed to play the game on one specific server this is the content pack for Omu Station. Omu Station strives to be a fork focused on more roleplay-centric gameplay while still focusing on community. We intend to take more mechanics from other forks and build a place where everyone can enjoy and play a unique shift every round.