Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/labeler-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This thing basically exists due to limitations of pull_request_review
# basically:
# "With the exception of GITHUB_TOKEN, secrets are not passed to the runner when a workflow is triggered from a forked repository.
# The GITHUB_TOKEN has read-only permissions in pull requests from forked repositories. For more information, see Use GITHUB_TOKEN for authentication in workflows."
#
# ^ and yeah, that also means you cannot give any more permissions to this either.
# so i'm having this run and running a diff workflow when this finishes. Worst that could happen is someone fucks with labels

name: "Review Trigger"

on:
pull_request_review_comment:
types: [edited]

jobs:
noop:
runs-on: ubuntu-latest
steps:
- name: Dummy step
run: echo "This is so incredibly fucking stupid"
196 changes: 117 additions & 79 deletions .github/workflows/labeler-review.yml
Original file line number Diff line number Diff line change
@@ -1,90 +1,128 @@
# SPDX-FileCopyrightText: 2024 Myra <vasilis@pikachu.systems>
# SPDX-FileCopyrightText: 2024 Saphire Lattice <lattice@saphi.re>
# SPDX-FileCopyrightText: 2024 Vasilis <vasilis@pikachu.systems>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

# This is shit and needs cleanup but since we are technically running this after a workflow that runs on the fork and not master i kinda want to make sure we use nothing from that workflow
# Forgive me for the mess.
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.name == 'Review Trigger' &&
github.event.workflow_run.event == 'pull_request_review_comment' &&
github.event.workflow_run.repository.full_name == github.repository &&
github.event.workflow_run.pull_requests[0].number != null
runs-on: ubuntu-latest

permissions:
contents: read
issues: write
pull-requests: write
runs-on: ubuntu-latest

steps:
- name: Create JSON File
id: curling-reviews
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
OWNER=${{ github.repository_owner }}
REPO=${{ github.event.repository.name }}
TOKEN=${{ secrets.GITHUB_TOKEN }}

# Fetch the reviews and place them into a json file.
curl -o reviews.json -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews

- name: Check for Approvals
id: check-approvals
run: |
# Count the number of approvals
APPROVALS=$(jq '[.[] | select(.state=="APPROVED")] | length' reviews.json)

echo "Number of approvals: $APPROVALS"
echo "::set-output name=approvals::$APPROVALS"

- name: Add Approved Label if Enough Approvals
if: steps.check-approvals.outputs.approvals >= 2 # Change the threshold here
uses: actions-ecosystem/action-add-labels@v1
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
with:
labels: "S: Approved"

- name: Remove Other Labels on Approved
if: steps.check-approvals.outputs.approvals >= 2
uses: actions-ecosystem/action-remove-labels@v1
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
with:
labels: |
"S: Needs Review"
"S: Needs Second Approval"

- name: Add Second Approval Requirement on Approval
if: steps.check-approvals.outputs.approvals == 1
uses: actions-ecosystem/action-add-labels@v1
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
with:
labels: |
"S: Needs Second Approval"
"S: Needs Review"

- name: Remove Other Labels on Second Approval Requirement
if: steps.check-approvals.outputs.approvals == 1
uses: actions-ecosystem/action-remove-labels@v1
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
with:
labels: "S: Approved"

- name: Remove All 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:
labels: |
"S: Approved"
"S: Needs Second Approval"
- name: Extract PR metadata
id: meta
run: |
PR_NUMBER=$(jq -r '.workflow_run.pull_requests[0].number' "$GITHUB_EVENT_PATH")
HEAD_SHA=$(jq -r '.workflow_run.head_sha' "$GITHUB_EVENT_PATH")

echo "pr=$PR_NUMBER" >> $GITHUB_OUTPUT
echo "sha=$HEAD_SHA" >> $GITHUB_OUTPUT

- name: Verify PR exists and SHA matches
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
PR_NUMBER: ${{ steps.meta.outputs.pr }}
HEAD_SHA: ${{ steps.meta.outputs.sha }}
run: |
curl -o pr.json \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_NUMBER

API_SHA=$(jq -r '.head.sha' pr.json)

if [ "$API_SHA" != "$HEAD_SHA" ]; then
echo "Commit SHA mismatch"
exit 1
fi

- name: Fetch reviews
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
PR_NUMBER: ${{ steps.meta.outputs.pr }}
run: |
curl -o reviews.json -L \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews

- name: Count approvals
id: check-approvals
run: |
APPROVALS=$(jq '
group_by(.user.login)
| map(last)
| map(select(.state=="APPROVED" and .user.type=="User"))
| length
' reviews.json)

echo "Number of approvals: $APPROVALS"
echo "approvals=$APPROVALS" >> $GITHUB_OUTPUT

- name: Add Approved Label if Enough Approvals
if: steps.check-approvals.outputs.approvals == 2
uses: actions-ecosystem/action-add-labels@v1
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
with:
number: ${{ steps.meta.outputs.pr }}
labels: "S: Approved"

- name: Remove Other Labels on Approved
if: steps.check-approvals.outputs.approvals >= 2
uses: actions-ecosystem/action-remove-labels@v1
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
with:
number: ${{ steps.meta.outputs.pr }}
labels: |
"S: Needs Review"
"S: Needs Second Approval"

- name: Add Second Approval Requirement
if: steps.check-approvals.outputs.approvals == 1
uses: actions-ecosystem/action-add-labels@v1
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
with:
number: ${{ steps.meta.outputs.pr }}
labels: |
"S: Needs Second Approval"
"S: Needs Review"

- 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.meta.outputs.pr }}
labels: "S: Approved"

- name: Remove 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.meta.outputs.pr }}
labels: |
"S: Approved"
"S: Needs Second Approval"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center"> <img alt="Space Station 14" width="1500" height="843" src="https://github.com/ProjectOmu/OmuStation/blob/master/Resources/Textures/Logo/logo.png" /></p>

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.
Thias 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.

@NotActuallyMarty NotActuallyMarty Mar 6, 2026

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aaacrazyyYyyy


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.

Expand Down