fix(ci): don't double-run test pipeline on pull requests#10
Merged
Conversation
Woodpecker treats `push` and `pull_request` as independent events. With `event: [push, pull_request]`, every PR fires the exact same pipeline twice (once as `ci/woodpecker/pr/test`, once as `ci/woodpecker/push/test`), each running `npm install` + typecheck + lint + test. That's ~52s of wasted compute per PR plus inconsistent check sets between PRs (some only surfaced `push/test`). Split the trigger so pull requests fire the PR pipeline once, and post-merge pushes to main/master fire the push pipeline once to confirm main stays green. Feature branches without an open PR no longer trigger CI — the signal we care about arrives when the PR opens. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Este PR ajusta o trigger da pipeline de testes do Woodpecker para evitar execução duplicada em pull requests, reduzindo custo de CI e deixando os checks mais previsíveis por evento.
Changes:
- Separa o
whenda pipeline de testes em dois casos:pull_requestepushsomente emmain/master. - Impede que pushes em branches de feature (sem PR) disparem a pipeline de testes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.woodpecker/test.yamlhoje usaevent: [push, pull_request], o que faz o Woodpecker disparar a pipeline duas vezes em cada PR — aparece comoci/woodpecker/pr/testeci/woodpecker/push/test, cada uma rodandonpm install+ typecheck + lint + test do zero.Changes
Split explícito do trigger:
```yaml
when:
event: pull_request
event: push
branch: [main, master]
```
PR aberta/atualizada → só
pr/test(1x)Push em
main/master(pós-merge) → sópush/test(1x, pra confirmar que main segue verde)Feature branch sem PR → nada dispara (se não tem PR, não é sinal que interessa ainda)
Why
npm installredundante × 3 steps × 2 execuções.push/test(sempr/testoupr/scan-pr), enquanto a feat: consume @platform/shell-contract from Nexus (drop the local copy) #7 recebeu os três. Depois do split, o conjunto de checks por PR vira previsível: sópr/*.Os outros dois pipelines (
scan-pr.yamljá sópull_request,scan.yamljá sópushem main) já estão com trigger adequado — não foram tocados.Follow-up depois do merge
Se houver branch protection exigindo checks, trocar required de
push/test→pr/testpra bater com o novo modelo. Sem isso, merge em PR nova vai ficar travando esperando check que nunca roda.Test plan
pr/test+pr/scan-pr(não maispush/testantes do merge)maindisparapush/test1xpr/testé o check obrigatório na branch protection (se houver)🤖 Generated with Claude Code