2 Commits

Author SHA1 Message Date
Codex
c92b01e0b6 fix(ci): replace actions-ecosystem with Gitea API calls for labelers
Some checks failed
CRLF Check / CRLF Check (pull_request) Successful in 52s
Test Packaging / Test Packaging (pull_request) Failing after 1m0s
RGA schema validator / YAML RGA schema validator (pull_request) Failing after 52s
Map file schema validator / YAML map schema validator (pull_request) Failing after 50s
Build & Test Map Renderer / build (ubuntu-latest) (pull_request) Failing after 11m40s
YAML Linter / YAML Linter (pull_request) Successful in 13m43s
Check Merge Conflicts / check-conflicts (pull_request_target) Successful in 5s
Labels: PR / labeler (pull_request_target) Successful in 48s
Labels: Size / size-label (pull_request_target) Successful in 3s
Build & Test Debug / build (ubuntu-latest) (pull_request) Successful in 43m51s
Build & Test Debug / Build & Test Debug (pull_request) Successful in 3s
Build & Test Map Renderer / Build & Test Debug (pull_request) Has been cancelled
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>
2025-12-23 22:58:35 +01:00
Codex
0cc69abd68 fix(ci): URL-encode label name in labeler-conflict.yml
Some checks failed
Close PRs on master / run (pull_request_target) Has been skipped
Labels: Review / add_label (pull_request_target) Failing after 3s
Labels: Untriaged / add_label (pull_request_target) Failing after 2s
Build & Test Map Renderer / build (ubuntu-latest) (pull_request) Successful in 3m10s
CRLF Check / CRLF Check (pull_request) Successful in 18s
Test Packaging / Test Packaging (pull_request) Failing after 31s
RGA schema validator / YAML RGA schema validator (pull_request) Failing after 24s
Map file schema validator / YAML map schema validator (pull_request) Failing after 23s
YAML Linter / YAML Linter (pull_request) Successful in 2m51s
Check Merge Conflicts / check-conflicts (pull_request_target) Successful in 1s
Labels: PR / labeler (pull_request_target) Successful in 17s
Labels: Size / size-label (pull_request_target) Successful in 2s
Build & Test Debug / build (ubuntu-latest) (pull_request) Successful in 51m41s
Build & Test Map Renderer / Build & Test Debug (pull_request) Successful in 3s
Build & Test Debug / Build & Test Debug (pull_request) Successful in 3s
The DELETE request for removing the "S: Merge Conflict" label was
failing with exit code 3 because the label name contains spaces and
a colon that weren't URL-encoded.

Uses jq @uri filter to properly encode: "S: Merge Conflict" →
"S%3A%20Merge%20Conflict"

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 22:45:32 +01:00
8 changed files with 59 additions and 55 deletions

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

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

View File

@@ -57,8 +57,10 @@ jobs:
if [ -n "$HAS_LABEL" ]; then
echo "Removing stale conflict label..."
# URL-encode the label name (handles spaces, colons, etc.)
LABEL_NAME_ENCODED=$(echo "$LABEL_NAME" | jq -rR @uri)
curl -s -X DELETE -H "Authorization: token $API_TOKEN" \
"$API_URL/repos/$REPO_OWNER/$REPO_NAME/issues/$PR_INDEX/labels/$LABEL_NAME"
"$API_URL/repos/$REPO_OWNER/$REPO_NAME/issues/$PR_INDEX/labels/$LABEL_NAME_ENCODED"
echo "Conflict label removed."
fi
fi

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

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"

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"

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"

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"