gendesign/.forgejo/workflows/stale-claims.yml
lekss361 297eb29d65 feat(claude): env-vars refactor + stale-claim cron (Phase 2 finalization)
#11: slash-commands и _autonomous_pickup.md теперь читают persistent User-scope
env vars напрямую (FORGEJO_TOKEN_<ROLE>) вместо file-based из ~/.claude/secrets/.

Один раз: scripts/setup-bot-env.ps1 (запускается user'ом локально, кладёт
токены из vault в Windows User registry). После этого окна grab credentials
через [System.Environment]::GetEnvironmentVariable() — никаких файлов.

Все 5 work-as-*.md обновлены (analyst/backend/frontend/reviewer/qa).

#12: stale-claim cleanup — cron каждые 30 минут.

- scripts/cleanup-stale-claims.sh — bash, parses Forgejo API + Python для JSON
- .forgejo/workflows/stale-claims.yml — cron schedule `*/30 * * * *`

Освобождает issues застрявшие в status/wip >4h:
  - assignees=[]
  - +status/ready -status/wip
  - comment "stale claim released, worker likely crashed"

Использует secret FORGEJO_BOT_QA_TOKEN (минимум прав = write:issue).

Setup: secret нужно завести в Forgejo Actions UI после merge —
git.gendsgn.ru/lekss361/gendesign/-/settings/actions/secrets.

Refs: PRs #608, #609. Closes TODO с PR #608 (stale-claim cron).
2026-05-28 00:24:45 +03:00

35 lines
1.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
jobs:
cleanup:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repo
uses: actions/checkout@v4
- 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: |
chmod +x scripts/cleanup-stale-claims.sh
./scripts/cleanup-stale-claims.sh