fix(ci): replace actions-ecosystem with Gitea API calls for labelers

actions-ecosystem actions don't work with Gitea (GitHub-only).
Replaced with direct Gitea API curl calls.

Affected workflows:
- labeler-approve.yml
- labeler-changes.yml
- labeler-needsreview.yml
- labeler-stable.yml
- labeler-staging.yml
- labeler-untriaged.yml

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Codex
2025-12-23 22:58:35 +01:00
parent 0cc69abd68
commit c92b01e0b6
7 changed files with 56 additions and 54 deletions
+8 -6
View File
@@ -1,4 +1,4 @@
name: "Labels: Approve"
name: "Labels: Approve"
on:
pull_request_review:
@@ -11,8 +11,10 @@ jobs:
if: github.event.review.state == 'approved'
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: |
Status: Needs Review
Status: Awaiting Changes
- name: Remove review labels
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
API="${{ github.server_url }}/api/v1/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels"
curl -sS -X DELETE -H "Authorization: token $GITHUB_TOKEN" "$API/Status%3A%20Needs%20Review" || true
curl -sS -X DELETE -H "Authorization: token $GITHUB_TOKEN" "$API/Status%3A%20Awaiting%20Changes" || true
+9 -7
View File
@@ -1,4 +1,4 @@
name: "Labels: Changes"
name: "Labels: Changes"
on:
pull_request_review:
@@ -11,9 +11,11 @@ jobs:
if: github.event.review.state == 'changes_requested'
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-add-labels@v1
with:
labels: "Status: Awaiting Changes"
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: "Status: Needs Review"
- name: Update labels
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
API="${{ github.server_url }}/api/v1/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels"
curl -sS -X POST -H "Authorization: token $GITHUB_TOKEN" -H "Content-Type: application/json" \
-d '{"labels":["Status: Awaiting Changes"]}' "$API"
curl -sS -X DELETE -H "Authorization: token $GITHUB_TOKEN" "$API/Status%3A%20Needs%20Review" || true
+9 -7
View File
@@ -1,4 +1,4 @@
name: "Labels: Review"
name: "Labels: Review"
on:
pull_request_target:
@@ -8,9 +8,11 @@ jobs:
add_label:
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-add-labels@v1
with:
labels: "S: Needs Review"
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: "S: Awaiting Changes"
- name: Update labels
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
API="${{ github.server_url }}/api/v1/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels"
curl -sS -X POST -H "Authorization: token $GITHUB_TOKEN" -H "Content-Type: application/json" \
-d '{"labels":["S: Needs Review"]}' "$API"
curl -sS -X DELETE -H "Authorization: token $GITHUB_TOKEN" "$API/S%3A%20Awaiting%20Changes" || true
-23
View File
@@ -1,23 +0,0 @@
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"
GITHUB_TOKEN: ${{ secrets.LABELER_PAT }}
- if: ${{ steps.checkUserMember.outputs.isTeamMember == 'true' }}
uses: actions-ecosystem/action-add-labels@v1
with:
labels: "S: Approved"
+9 -3
View File
@@ -11,6 +11,12 @@ jobs:
add_label:
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-add-labels@v1
with:
labels: "Branch: Stable"
- name: Add branch label
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -sS -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/json" \
-d '{"labels":["Branch: Stable"]}' \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels"
+9 -3
View File
@@ -11,6 +11,12 @@ jobs:
add_label:
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-add-labels@v1
with:
labels: "Branch: Staging"
- name: Add branch label
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -sS -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/json" \
-d '{"labels":["Branch: Staging"]}' \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels"
+12 -5
View File
@@ -1,4 +1,4 @@
name: "Labels: Untriaged"
name: "Labels: Untriaged"
on:
issues:
@@ -10,7 +10,14 @@ jobs:
add_label:
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-add-labels@v1
if: join(github.event.issue.labels) == ''
with:
labels: "S: Untriaged"
- name: Add untriaged label
if: github.event.issue.labels[0] == null || github.event.pull_request.labels[0] == null
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
NUMBER="${{ github.event.pull_request.number || github.event.issue.number }}"
curl -sS -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/json" \
-d '{"labels":["S: Untriaged"]}' \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/issues/$NUMBER/labels"