fix: automerge safety net só para agent/* (espelha teqo — GITHUB_TOKEN não mergea em repo de org); remove workflow de debug
All checks were successful
Agent PR Ready + auto-merge / ready-automerge (pull_request) Has been skipped
Main merge flips claimed issues to done + in-prod / issue-done (pull_request) Successful in 4s
Promote plan-issue Related on main merge / plan-issue-ready (pull_request) Has been skipped
CI / checks (pull_request) Successful in 21s
CI / deploy (pull_request) Has been skipped
CI / checks (push) Successful in 21s
CI / deploy (push) Successful in 9s

This commit is contained in:
Francisco Solla 2026-08-17 22:08:39 -03:00
parent 8bc6ea0536
commit c4f6dd159f
2 changed files with 12 additions and 29 deletions

View file

@ -1,7 +1,12 @@
# Safety net: PRs de entrega (feature → main) devem ser Ready + auto-merge.
# Cobre o caso de um agente esquecer de armar o merge. Roda
# scripts/forgejo-pr-automerge.mjs (plain Node): marca draft → ready, espera o
# status check `checks` (branch protection em main) e mergea por rebase.
# Safety net (espelha o teqo): PRs de branch `agent/*` → main devem ser Ready +
# auto-merge. PRs humanos não passam por aqui — o merge deles é feito pelo
# agente local via `bun run pr -- --automerge` (com o PAT do usuário, que tem
# permissão de merge; o usuário sintético `forgejo-actions` do GITHUB_TOKEN não
# consegue mergear em repos de org).
#
# Roda scripts/forgejo-pr-automerge.mjs (plain Node): marca draft → ready, espera
# o contexto `checks` ficar green (ignorando o próprio status do job) e mergea
# por rebase.
name: Agent PR Ready + auto-merge
@ -12,7 +17,9 @@ on:
jobs:
ready-automerge:
if: github.event.pull_request.state == 'open'
if: >-
github.event.pull_request.state == 'open' &&
startsWith(github.event.pull_request.head.ref, 'agent/')
runs-on: host
timeout-minutes: 40
steps:

View file

@ -1,24 +0,0 @@
name: Debug token
on:
workflow_dispatch:
push:
branches: [OPS1-setup-workflow-teqo]
jobs:
debug:
runs-on: host
timeout-minutes: 5
steps:
- name: Quem é o GITHUB_TOKEN
run: |
echo "GITHUB_TOKEN user:"
curl -s -H "Authorization: token $GITHUB_TOKEN" https://git.solla.dev/api/v1/user
echo
echo "Permissões no repo:"
curl -s -H "Authorization: token $GITHUB_TOKEN" "https://git.solla.dev/api/v1/repos/amana/iara-pwa"
echo
echo "Tentando criar label (escrita):"
curl -s -o /dev/null -w "%{http_code}\n" -X POST -H "Authorization: token $GITHUB_TOKEN" -H "Content-Type: application/json" "https://git.solla.dev/api/v1/repos/amana/iara-pwa/labels" -d '{"name":"debug-token-test","color":"ff0000"}'
echo "Tentando remover label:"
curl -s -o /dev/null -w "%{http_code}\n" -X DELETE -H "Authorization: token $GITHUB_TOKEN" "https://git.solla.dev/api/v1/repos/amana/iara-pwa/labels/debug-token-test"