Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1153c0e
ops: inspect existing Cloudflare container compute
AyobamiH Sep 27, 2026
fd5ac96
ops: provision isolated Cloudflare compute and probe repair containment
AyobamiH Sep 27, 2026
7263dad
ops: tolerate probe secret propagation and cancel obsolete runner
AyobamiH Sep 27, 2026
c73034e
ops: verify existing App authority for Cloudflare runner registration
AyobamiH Sep 27, 2026
a722eb5
ops: register and prove ephemeral Cloudflare GitHub runner
AyobamiH Sep 27, 2026
4554599
ops: inspect Cloudflare runner process connection
AyobamiH Sep 27, 2026
b73ef60
ops: release superseded runner test queues
AyobamiH Sep 27, 2026
26e3a86
ops: retain runner startup diagnostics and require online readiness
AyobamiH Sep 27, 2026
01562d4
ops: include repair tooling and bounded runner cleanup
AyobamiH Sep 27, 2026
4e60fb7
ops: launch bounded ChatGPT repair on Cloudflare ephemeral runners
AyobamiH Sep 27, 2026
5407bb8
ops: open and restore approved bounded repair execution window
AyobamiH Sep 27, 2026
53f46d0
ops: verify rolled-out repair tools after cleaning test runners
AyobamiH Sep 27, 2026
5bf8851
ops: clean up completed Cloudflare proof compute
AyobamiH Sep 27, 2026
41bc1e7
fix: request canonical Actions variables permission for repair window
AyobamiH Sep 27, 2026
ec3723a
security: revoke test runner credentials and remove affected launcher…
AyobamiH Sep 27, 2026
5d438ea
fix: isolate runner responses from credential masking commands
AyobamiH Sep 27, 2026
7fbaa16
fix: pin GitHub CLI with paginated slurp support for Cloudflare repairs
AyobamiH Sep 27, 2026
d012232
ops: cancel obsolete Blacksmith publication follow-on
AyobamiH Sep 27, 2026
323244b
fix: publish repair artifacts through authorised GitHub orchestration
AyobamiH Sep 27, 2026
a9ac4cb
ops: expose bounded credential-free repair progress metadata
AyobamiH Sep 27, 2026
12a0ed3
ops: identify active validation processes without reading arguments
AyobamiH Sep 27, 2026
b69e868
ops: recognise Node main threads in bounded progress diagnostics
AyobamiH Sep 27, 2026
a0b597e
ops: retain exact repair receipts and retire completed Cloudflare run…
AyobamiH Sep 27, 2026
9868c58
ops: provision pinned operator host fixtures for Cloudflare acceptance
AyobamiH Sep 27, 2026
fb8795d
ops: provision private renderer fixture through existing state access
AyobamiH Sep 27, 2026
242bfb1
fix: route repair reviews to owned service and request subscription-o…
AyobamiH Sep 27, 2026
b6d7927
ops: retire completed fixture containers with explicit runner identities
AyobamiH Sep 27, 2026
6336715
ops: allow bounded secret propagation before container cleanup
AyobamiH Sep 27, 2026
5f53050
docs: retain fixture acceptance and make reprovisioning explicit
AyobamiH Sep 27, 2026
6c2b8bc
feat: provision bounded Cloudflare repair runners and retire Blacksmi…
AyobamiH Sep 27, 2026
03b7fa4
test: verify runner readiness and review proven Cloudflare lifecycle
AyobamiH Sep 27, 2026
bc645fc
chore: retain approved action version annotation in infrastructure proof
AyobamiH Sep 27, 2026
21a9c07
fix: bound Cloudflare failure cleanup and preserve queued jobs
AyobamiH Sep 27, 2026
a7950f0
test: preserve complete review workflow regression coverage
AyobamiH Sep 27, 2026
15d0a5a
ci: apply shared subscription admission to hosted review smoke
AyobamiH Sep 27, 2026
1139bc9
docs: align operator credentials and Cloudflare proof boundaries
AyobamiH Sep 27, 2026
3f8c8d7
fix: close Cloudflare lifecycle and validation gaps
AyobamiH Sep 28, 2026
e6e3bb5
fix: harden cleanup and rerun lifecycle
AyobamiH Sep 28, 2026
8e63e53
fix: retain result records for configured owners
AyobamiH Sep 28, 2026
b914cc4
docs: bind fleet proof review to exact head
AyobamiH Sep 28, 2026
9a3ee9e
fix: make Cloudflare lifecycle retries effective
AyobamiH Sep 28, 2026
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
24 changes: 24 additions & 0 deletions .github/actions/cloudflare-runners/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Bounded Cloudflare repair runners
description: Start or destroy this workflow run's two ephemeral Cloudflare runners.
inputs:
operation:
description: start or stop
required: true
outputs:
plan:
description: Unique planning runner label
value: ${{ steps.lifecycle.outputs.plan }}
execute:
description: Unique execution runner label
value: ${{ steps.lifecycle.outputs.execute }}
attempt:
description: Workflow attempt that provisioned these runners
value: ${{ steps.lifecycle.outputs.attempt }}
runs:
using: composite
steps:
- id: lifecycle
shell: bash
env:
RUNNER_OPERATION: ${{ inputs.operation }}
run: bash "${{ github.action_path }}/lifecycle.sh"
81 changes: 81 additions & 0 deletions .github/actions/cloudflare-runners/lifecycle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/usr/bin/env bash
set -euo pipefail
case "${RUNNER_OPERATION:?}" in start|stop) ;; *) exit 2;; esac
: "${GH_TOKEN:?}"
# Stable across jobs and attempts. A cleanup-only rerun must target the runners
# created by the original attempt instead of deriving new, orphan-prone names.
nonce="$(printf '%s' "$GITHUB_REPOSITORY:$GITHUB_RUN_ID" | sha256sum | cut -c1-16)"
echo "attempt=$GITHUB_RUN_ATTEMPT" >> "$GITHUB_OUTPUT"
endpoint=https://ayobamih-clawsweeper-compute.woeinvests.workers.dev
scratch_dir="$(mktemp -d)"
trap 'rm -rf "$scratch_dir"' EXIT
cleanup_failed=0
cloudflare_ready=1
probe_token=""
if [ "$RUNNER_OPERATION" = start ]; then
: "${CLOUDFLARE_API_TOKEN:?}" "${CLOUDFLARE_ACCOUNT_ID:?}"
npm ci --prefix cloudflare-repair --no-audit --no-fund >/dev/null
probe_token="$(openssl rand -hex 32)"
printf '\n::add-mask::%s\n' "$probe_token"
printf '%s' "$probe_token" | (cd cloudflare-repair && npx wrangler secret put PROBE_TOKEN)
else
if [ -z "${CLOUDFLARE_API_TOKEN:-}" ] || [ -z "${CLOUDFLARE_ACCOUNT_ID:-}" ]; then
echo "Cloudflare cleanup credentials are unavailable; continuing GitHub runner deregistration" >&2
cloudflare_ready=0
cleanup_failed=1
elif ! npm ci --prefix cloudflare-repair --no-audit --no-fund >/dev/null; then
echo "Cloudflare cleanup dependencies could not be installed; continuing GitHub runner deregistration" >&2
cloudflare_ready=0
cleanup_failed=1
else
probe_token="$(openssl rand -hex 32)"
printf '\n::add-mask::%s\n' "$probe_token"
if ! printf '%s' "$probe_token" | (cd cloudflare-repair && npx wrangler secret put PROBE_TOKEN); then
echo "Cloudflare cleanup credential rotation failed; continuing GitHub runner deregistration" >&2
cloudflare_ready=0
cleanup_failed=1
fi
fi
fi
for lane in plan execute; do
runner_name="csw-$nonce-$lane"
echo "$lane=$runner_name" >> "$GITHUB_OUTPUT"
if [ "$RUNNER_OPERATION" = start ]; then
registration="$(gh api --method POST "repos/$GITHUB_REPOSITORY/actions/runners/generate-jitconfig" -f name="$runner_name" -F runner_group_id=1 -f 'labels[]=self-hosted' -f 'labels[]=Linux' -f 'labels[]=X64' -f "labels[]=$runner_name" --jq .encoded_jit_config)"
printf '\n::add-mask::%s\n' "$registration"
jq -n --arg name "$runner_name" --arg jit "$registration" '{name:$name,jit:$jit}' > "$scratch_dir/request.json"
verb=POST
else
jq -n --arg name "$runner_name" '{name:$name}' > "$scratch_dir/request.json"
verb=DELETE
fi
response_ok=0
if [ "$cloudflare_ready" = 1 ] && curl --fail --silent --show-error --retry 6 --retry-all-errors --retry-delay 5 --retry-max-time 180 --max-time 45 --request "$verb" --header "Authorization: Bearer $probe_token" --header 'Content-Type: application/json' --data-binary @"$scratch_dir/request.json" --output "$scratch_dir/response.json" "$endpoint/runner"; then
if jq -e --arg key "$([ "$verb" = POST ] && echo started || echo stopped)" '.[$key] == true' "$scratch_dir/response.json" >/dev/null; then response_ok=1; fi
fi
if [ "$response_ok" != 1 ]; then
if [ "$RUNNER_OPERATION" = start ]; then exit 1; fi
cleanup_failed=1
echo "Container cleanup failed for $runner_name; continuing remaining cleanup" >&2
fi
if [ "$RUNNER_OPERATION" = start ]; then
runner_status=offline
for attempt in $(seq 1 18); do
runner_status="$(gh api "repos/$GITHUB_REPOSITORY/actions/runners" --jq ".runners[] | select(.name == \"$runner_name\") | .status")"
if [ "$runner_status" = online ]; then break; fi
sleep 5
done
if [ "$runner_status" != online ]; then
echo "Runner did not become online within the bounded startup window: $runner_name" >&2
exit 1
fi
fi
if [ "$RUNNER_OPERATION" = stop ]; then
gh api "repos/$GITHUB_REPOSITORY/actions/runners" --jq ".runners[] | select(.name == \"$runner_name\") | .id" > "$scratch_dir/runner-ids" || cleanup_failed=1
while read -r runner_id; do
[ -z "$runner_id" ] || gh api --method DELETE "repos/$GITHUB_REPOSITORY/actions/runners/$runner_id" || cleanup_failed=1
done < "$scratch_dir/runner-ids"
fi
if [ "$response_ok" = 1 ]; then echo "$RUNNER_OPERATION completed for $runner_name"; fi
done
exit "$cleanup_failed"
16 changes: 8 additions & 8 deletions .github/workflows/assist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
CLAWSWEEPER_APP_CLIENT_ID: ${{ vars.CLAWSWEEPER_APP_CLIENT_ID || 'Iv23li7FTsSTorJDMkdQ' }}
CLAWSWEEPER_MODEL: internal
CLAWSWEEPER_RUNNER: ${{ vars.CLAWSWEEPER_RUNNER || 'codex' }}
CLAWSWEEPER_RUNNER: codex
CLAWSWEEPER_OPENCLAW_MODEL: ${{ secrets.CLAWSWEEPER_OPENCLAW_MODEL }}
CLAWSWEEPER_OPENCLAW_PROVIDERS_JSON: ${{ secrets.CLAWSWEEPER_OPENCLAW_PROVIDERS_JSON }}
CLAWSWEEPER_OPENCLAW_OPENAI_KEY: ${{ vars.CLAWSWEEPER_RUNNER == 'openclaw' && secrets.OPENAI_API_KEY || '' }}
ANTHROPIC_API_KEY: ${{ vars.CLAWSWEEPER_RUNNER == 'openclaw' && secrets.ANTHROPIC_API_KEY || '' }}
GEMINI_API_KEY: ${{ vars.CLAWSWEEPER_RUNNER == 'openclaw' && secrets.GEMINI_API_KEY || '' }}
KIMI_API_KEY: ${{ vars.CLAWSWEEPER_RUNNER == 'openclaw' && secrets.KIMI_API_KEY || '' }}
OPENROUTER_API_KEY: ${{ vars.CLAWSWEEPER_RUNNER == 'openclaw' && secrets.OPENROUTER_API_KEY || '' }}
CLAWSWEEPER_OPENCLAW_PROVIDERS_JSON: ""
CLAWSWEEPER_OPENCLAW_OPENAI_KEY: ""
ANTHROPIC_API_KEY: ""
GEMINI_API_KEY: ""
KIMI_API_KEY: ""
OPENROUTER_API_KEY: ""

concurrency:
group: ${{ format('clawsweeper-assist-{0}-{1}-{2}', github.event.client_payload.target_repo || inputs.target_repo || 'openclaw/openclaw', github.event.client_payload.item_number || inputs.item_number || 'unknown', github.event.client_payload.comment_id || inputs.comment_id || 'manual') }}
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
assist:
needs: capacity
if: ${{ needs.capacity.outputs.proceed == 'true' }}
runs-on: ${{ vars.CLAWSWEEPER_WORKER_RUNNER || 'blacksmith-4vcpu-ubuntu-2404' }}
runs-on: ubuntu-latest
timeout-minutes: 8
outputs:
generation_attempt: ${{ steps.generate.outputs.generation_attempt }}
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/automerge-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
automerge-e2e:
name: production automerge flow
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ${{ vars.CLAWSWEEPER_E2E_RUNNER || 'blacksmith-16vcpu-ubuntu-2404' }}
runs-on: ubuntu-latest
timeout-minutes: 15
env:
AUTOMERGE_E2E_BASE_ARCHIVE: /tmp/clawsweeper-automerge-e2e-base.tar
Expand All @@ -42,6 +42,12 @@ jobs:
with:
persist-credentials: false

- name: Enable nested unprivileged namespaces on the disposable CI host
run: |
set -euo pipefail
sudo sysctl -w kernel.unprivileged_userns_clone=1
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0

- name: Restore repository-built base image
id: base-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ concurrency:
jobs:
hosted-review-scan:
name: Hosted native review scan smoke
env:
CLAWSWEEPER_QUOTA_ENABLED: "1"
CLAWSWEEPER_QUOTA_URL: ${{ vars.CLAWSWEEPER_EXACT_REVIEW_QUEUE_URL }}
CLAWSWEEPER_QUOTA_SECRET: ${{ secrets.CLAWSWEEPER_WEBHOOK_SECRET }}
if: >-
${{ github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' &&
Expand Down
188 changes: 188 additions & 0 deletions .github/workflows/cloudflare-operator-fixtures.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
name: Prove operator host fixtures on Cloudflare
"on":
workflow_dispatch: {}
permissions:
contents: read
concurrency:
group: cloudflare-repair-compute
queue: max
cancel-in-progress: false
jobs:
launch:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Create scoped runner and dispatch token
id: app
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.CLAWSWEEPER_APP_CLIENT_ID || 'Iv23li7FTsSTorJDMkdQ' }}
private-key: ${{ secrets.CLAWSWEEPER_APP_PRIVATE_KEY }}
owner: AyobamiH
repositories: clawsweeper
permission-administration: write
permission-actions: write
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Start isolated Cloudflare validation runner
id: launch
env:
GH_TOKEN: ${{ steps.app.outputs.token }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
WRANGLER_SEND_METRICS: "false"
run: |
set -euo pipefail
cd cloudflare-repair
npm ci --no-audit --no-fund
npx wrangler deploy --containers-rollout=none
probe_token="$(openssl rand -hex 32)"
echo "::add-mask::$probe_token"
printf '%s' "$probe_token" | npx wrangler secret put PROBE_TOKEN
nonce="$(printf '%s' "$GITHUB_REPOSITORY:$GITHUB_RUN_ID" | sha256sum | cut -c1-16)"
echo "runner=csw-$nonce-execute" >> "$GITHUB_OUTPUT"
echo "attempt=$GITHUB_RUN_ATTEMPT" >> "$GITHUB_OUTPUT"
payload="$RUNNER_TEMP/runner-start.json"
trap 'rm -f "$payload"' EXIT
for lane in execute; do
runner_name="csw-$nonce-$lane"
registration="$(gh api --method POST repos/AyobamiH/clawsweeper/actions/runners/generate-jitconfig -f name="$runner_name" -F runner_group_id=1 -f 'labels[]=self-hosted' -f 'labels[]=Linux' -f 'labels[]=X64' -f "labels[]=$runner_name" --jq .encoded_jit_config)"
printf '\n::add-mask::%s\n' "$registration"
jq -n --arg name "$runner_name" --arg jit "$registration" '{name:$name,jit:$jit}' > "$payload"
curl --fail --silent --show-error --retry 3 --retry-all-errors --retry-delay 10 --retry-max-time 180 --max-time 60 --request POST --header "Authorization: Bearer $probe_token" --header 'Content-Type: application/json' --data-binary @"$payload" --output "$RUNNER_TEMP/runner-start-response.json" https://ayobamih-clawsweeper-compute.woeinvests.workers.dev/runner
done
for lane in execute; do
runner_name="csw-$nonce-$lane"
for attempt in $(seq 1 12); do
runner_status="$(gh api repos/AyobamiH/clawsweeper/actions/runners --jq ".runners[] | select(.name == \"$runner_name\") | .status")"
if [ "$runner_status" = online ]; then break; fi
sleep 5
done
if [ "$runner_status" != online ]; then
echo "Cloudflare runner $runner_name did not become online; repair not dispatched."
exit 1
fi
done
outputs:
runner: ${{ steps.launch.outputs.runner }}
attempt: ${{ steps.launch.outputs.attempt }}
validate:
needs: launch
runs-on: ${{ needs.launch.outputs.attempt == format('{0}', github.run_attempt) && needs.launch.outputs.runner || 'ubuntu-latest' }}
timeout-minutes: 20
steps:
- name: Require fresh fixture compute for this attempt
if: ${{ needs.launch.outputs.attempt != format('{0}', github.run_attempt) }}
run: |
echo "A failed-jobs-only rerun cannot reuse destroyed Cloudflare fixture compute; rerun all jobs." >&2
exit 1
- uses: actions/setup-node@v6
with:
node-version: 24.18.1
- name: Read private pinned fixture
id: fixture
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.CLAWSWEEPER_APP_CLIENT_ID || 'Iv23li7FTsSTorJDMkdQ' }}
private-key: ${{ secrets.CLAWSWEEPER_APP_PRIVATE_KEY }}
owner: AyobamiH
repositories: clawsweeper-state
permission-contents: read
- uses: actions/checkout@v7
with:
repository: AyobamiH/clawsweeper-state
ref: 2baf6b1b2bca132c22756b9d23469bec177a7677
token: ${{ steps.fixture.outputs.token }}
path: private-fixture
sparse-checkout: fixtures/operator-10/renderer
persist-credentials: false
- name: Provision pinned real host sources and run all adapter tests
shell: bash
run: |
set -euo pipefail
project_root=/home/oneclickwebsitedesignfactory/.openclaw/workspace/projects
mkdir -p "$project_root" "$RUNNER_TEMP/operator-proof"
git clone --no-checkout https://github.com/AyobamiH/openclaw-operator.git "$project_root/openclaw-operator"
git -C "$project_root/openclaw-operator" checkout --detach c50244478afcc394732376f7e28448368ef02bad
mkdir -p "$project_root/relay-live-business-engagement-connector/local-media-renderer/bin"
cp "$GITHUB_WORKSPACE/private-fixture/fixtures/operator-10/renderer/local-media-renderer.mjs" "$project_root/relay-live-business-engagement-connector/local-media-renderer/bin/local-media-renderer.mjs"
cp "$GITHUB_WORKSPACE/private-fixture/fixtures/operator-10/renderer/provenance.json" "$RUNNER_TEMP/operator-proof/renderer-provenance.json"
cd "$project_root/openclaw-operator"
test -f config/publishing/registry.v1.json
test -f systemd/orchestrator-graph-zero-write-canary.conf
test -f "$project_root/relay-live-business-engagement-connector/local-media-renderer/bin/local-media-renderer.mjs"
git rev-parse HEAD > "$RUNNER_TEMP/operator-proof/operator-head.txt"
printf '%s\n' 495cac2013bc55533751a09e1bb499119b7de0bf > "$RUNNER_TEMP/operator-proof/renderer-head.txt"
sha256sum orchestrator/src/graph/production-adapters.ts orchestrator/test/graph-production-adapters.test.ts orchestrator/package-lock.json "$project_root/relay-live-business-engagement-connector/local-media-renderer/bin/local-media-renderer.mjs" > "$RUNNER_TEMP/operator-proof/input-sha256.txt"
npm ci --prefix orchestrator --ignore-scripts --no-audit --no-fund
set +e
npm --prefix orchestrator run test:run -- test/graph-production-adapters.test.ts --reporter=verbose --reporter=json --outputFile.json="$RUNNER_TEMP/operator-proof/full-adapter.json" > "$RUNNER_TEMP/operator-proof/full-adapter.log" 2>&1
test_status=$?
set -e
cat "$RUNNER_TEMP/operator-proof/full-adapter.log"
printf '%s\n' "$test_status" > "$RUNNER_TEMP/operator-proof/test-exit.txt"
git diff --check bde909ea422f22713e3cd4ca0b45ca018f2c1150
git status --porcelain > "$RUNNER_TEMP/operator-proof/worktree-status.txt"
exit "$test_status"
- uses: actions/upload-artifact@v7
if: always()
with:
name: operator-10-provisioned-host-proof
path: ${{ runner.temp }}/operator-proof
if-no-files-found: error
cleanup:
needs:
- launch
- validate
if: ${{ always() }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Create scoped cleanup credential
id: app
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.CLAWSWEEPER_APP_CLIENT_ID || 'Iv23li7FTsSTorJDMkdQ' }}
private-key: ${{ secrets.CLAWSWEEPER_APP_PRIVATE_KEY }}
owner: AyobamiH
repositories: clawsweeper
permission-administration: write
- name: Destroy isolated fixture container
env:
GH_TOKEN: ${{ steps.app.outputs.token }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
WRANGLER_SEND_METRICS: "false"
run: |
set -euo pipefail
nonce="$(printf '%s' "$GITHUB_REPOSITORY:$GITHUB_RUN_ID" | sha256sum | cut -c1-16)"
FIXTURE_RUNNER_NAME="csw-$nonce-execute"
cleanup_failed=0
cloudflare_ready=1
if ! npm ci --prefix cloudflare-repair --no-audit --no-fund; then
echo "Fixture cleanup dependencies could not be installed; continuing GitHub runner deregistration" >&2
cloudflare_ready=0
cleanup_failed=1
else
probe_token="$(openssl rand -hex 32)"
echo "::add-mask::$probe_token"
if ! printf '%s' "$probe_token" | (cd cloudflare-repair && npx wrangler secret put PROBE_TOKEN); then
echo "Fixture cleanup credential rotation failed; continuing GitHub runner deregistration" >&2
cloudflare_ready=0
cleanup_failed=1
fi
fi
if [ "$cloudflare_ready" = 1 ]; then
jq -n --arg name "$FIXTURE_RUNNER_NAME" '{name:$name}' > "$RUNNER_TEMP/cleanup.json"
curl --fail --silent --show-error --retry 6 --retry-all-errors --retry-delay 5 --retry-max-time 180 --max-time 45 --request DELETE --header "Authorization: Bearer $probe_token" --header 'Content-Type: application/json' --data-binary @"$RUNNER_TEMP/cleanup.json" --output "$RUNNER_TEMP/cleanup-response.json" https://ayobamih-clawsweeper-compute.woeinvests.workers.dev/runner || cleanup_failed=1
fi
gh api repos/AyobamiH/clawsweeper/actions/runners \
--jq ".runners[] | select(.name == \"$FIXTURE_RUNNER_NAME\") | .id" > "$RUNNER_TEMP/fixture-runner-ids" || cleanup_failed=1
while read -r runner_id; do
[ -z "$runner_id" ] || gh api --method DELETE "repos/AyobamiH/clawsweeper/actions/runners/$runner_id" || cleanup_failed=1
done < "$RUNNER_TEMP/fixture-runner-ids"
exit "$cleanup_failed"
Loading
Loading