gendesign/.forgejo/workflows/stale-claims.yml
lekss361 b86688bc0f chore(workflow): add diagnostic output to stale-claims.yml
Adds runner env + token sanity check + bash -x trace перед запуском cleanup
script. Цель — увидеть actual failure cause в Forgejo Actions logs (manual
runs #1514-1517 все упали ~4s, но script локально работает с тем же PAT).

Diag steps:
- runner environment (python3/curl/mktemp)
- token validity (curl /api/v1/user)
- bash -x для script trace

После merge — trigger manual dispatch + читать logs. Diagnostic строки уберём
fixup-commit'ом после диагноза.

Refs: PR #610 (stale-claims initial), runs #1514-1517 failures.
2026-05-28 01:01:29 +03:00

60 lines
2.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Cleanup stale claims for autonomous multi-agent workflow.
#
# Запускается каждые 30 минут (cron). Освобождает issues застрявшие в
# `status/wip` дольше 4 часов. См. `scripts/cleanup-stale-claims.sh`.
#
# Secrets:
# FORGEJO_BOT_QA_TOKEN — bot-qa PAT (write:issue scope нужен).
# Можно использовать любой bot-PAT с write:issue, но bot-qa имеет минимум прав.
name: cleanup-stale-claims
on:
schedule:
# Каждые 30 минут UTC
- cron: '*/30 * * * *'
workflow_dispatch: {} # manual run возможен через UI
concurrency:
group: stale-claims
cancel-in-progress: false
jobs:
cleanup:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Diagnostic — runner environment
run: |
echo "=== runner environment ==="
echo "shell: $SHELL"
echo "bash: $(bash --version | head -1)"
echo "python3: $(python3 --version 2>&1 || echo 'NOT INSTALLED')"
echo "curl: $(curl --version | head -1)"
echo "mktemp: $(mktemp --version | head -1 2>&1 || echo 'no --version')"
echo "pwd: $(pwd)"
echo "ls scripts/: $(ls scripts/ 2>&1)"
echo "script exists: $(test -f scripts/cleanup-stale-claims.sh && echo yes || echo no)"
- name: Run cleanup script
env:
FORGEJO_TOKEN: ${{ secrets.FORGEJO_BOT_QA_TOKEN }}
FORGEJO_URL: https://git.gendsgn.ru
FORGEJO_REPO: lekss361/gendesign
STALE_HOURS: 4
run: |
echo "=== env check ==="
echo "FORGEJO_TOKEN length: ${#FORGEJO_TOKEN}"
echo "FORGEJO_URL: $FORGEJO_URL"
echo "FORGEJO_REPO: $FORGEJO_REPO"
echo "STALE_HOURS: $STALE_HOURS"
echo "=== check token works ==="
curl -sS -H "Authorization: token $FORGEJO_TOKEN" "$FORGEJO_URL/api/v1/user" | head -c 200
echo ""
echo "=== run script with -x trace ==="
chmod +x scripts/cleanup-stale-claims.sh
bash -x scripts/cleanup-stale-claims.sh