docs: ajuste de AGENTS.md/ci.yml (gate = automerge, sem branch protection) #2

Merged
fsolla merged 3 commits from OPS1-setup-workflow-teqo into main 2026-08-18 01:08:45 +00:00
2 changed files with 12 additions and 29 deletions
Showing only changes of commit c4f6dd159f - Show all commits

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"