Skip to content

Commit 4127fb0

Browse files
frostebiteclaude
andauthored
feat: add manual cleanup workflow for stuck builds (#277)
Adds a workflow_dispatch triggered workflow that calls the versioning backend's cleanUpStuckBuilds endpoint. Maintainers can trigger it from the Actions tab to process all stuck "started" builds immediately. Requires typing "yes" to confirm, to prevent accidental triggers. Uses the existing VERSIONING_TOKEN secret for auth. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 81d5923 commit 4127fb0

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Clean Up Stuck Builds
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
confirm:
7+
description: 'Type "yes" to confirm cleanup of all stuck builds'
8+
required: true
9+
default: ''
10+
11+
jobs:
12+
cleanup:
13+
name: Clean up stuck builds
14+
runs-on: ubuntu-latest
15+
if: ${{ github.event.inputs.confirm == 'yes' }}
16+
steps:
17+
- name: Trigger manual cleanup
18+
run: |
19+
echo "Triggering manual cleanup of stuck builds..."
20+
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST \
21+
-H "Authorization: Bearer ${{ secrets.VERSIONING_TOKEN }}" \
22+
-H "Content-Type: application/json" \
23+
"https://europe-west3-unity-ci-versions.cloudfunctions.net/cleanUpStuckBuilds")
24+
25+
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
26+
BODY=$(echo "$RESPONSE" | head -n -1)
27+
28+
echo "HTTP Status: $HTTP_CODE"
29+
echo "$BODY" | jq . 2>/dev/null || echo "$BODY"
30+
31+
if [ "$HTTP_CODE" -ne 200 ]; then
32+
echo "::error::Cleanup request failed with status $HTTP_CODE"
33+
exit 1
34+
fi
35+
36+
echo "::notice::Cleanup completed successfully"

0 commit comments

Comments
 (0)