Commit Graph

11 Commits

Author SHA1 Message Date
Carlos Florêncio 5efe9f1df1 fix(ci): disable track_progress for labeled event in claude-review-fork (#1067) 2026-05-24 21:28:31 +01:00
José Almeida 122ea73f55 feat(workflow): queue workflow messages during active moves (#1036) 2026-05-23 17:19:23 +01:00
João Salavisa 9d2e572ffd ci: strip safe-to-review label on new fork pushes (#992)
* ci: strip safe-to-review label on new fork pushes

Mirrors the strip-safe-to-test job in preview-env.yml so a once-approved
fork PR cannot run the Claude review against new (potentially malicious)
code on subsequent pushes without fresh maintainer re-approval. Closes a
gap between the two pull_request_target workflows flagged by an external
scanner.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* ci: close strip-label race on fork PRs

Three reviewers (CodeRabbit, cubic, Greptile) flagged that strip-safe-to-review
ran in parallel with claude-review-fork on the same synchronize event, so the
label was still present in the webhook snapshot when the review job's if was
evaluated — the strip only blocked the next push, not the current one. Same
flaw existed for preview-env.yml's deploy-fork (worse there, since it runs
the fork's cmd/preview code with SPRITES_API_TOKEN).

Fix:
- Add `labeled` to pull_request_target types so a maintainer applying the
  opt-in label triggers a review/deploy against the current head SHA.
- Guard the label clause in claude-review-fork / deploy-fork with
  `github.event.action != 'synchronize'`. Trusted-author paths (OWNER /
  MEMBER / COLLABORATOR and the *_ALLOWLIST repo variable) still authorize
  on every event; only the label path is per-commit.
- Wrap removeLabel calls in try/catch that swallows 404 on races.
- Add workflow-level concurrency to dedupe rapid pushes (cancel-in-progress
  is false on `closed` for preview-env so cleanup can finish).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* ci: reorder fork PR if-gate branches to be fromJSON-safe

cubic flagged that the previous reorder put the `fromJSON(vars.*_ALLOWLIST)`
branch before the label clause. A non-empty but malformed allowlist value
would throw and skip the whole job, masking a legitimate maintainer label
approval. Reorder to: author_association -> label (with synchronize guard)
-> allowlist, so the cheap/safe branches short-circuit before any
potentially throwing fromJSON call. Applied to both fork workflows.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Kandev Agent <agent@kandev.dev>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 14:36:22 +01:00
Carlos Florêncio 367700f507 ci: stop Claude code review workflow from committing to PRs (#683) 2026-04-23 18:35:49 +01:00
Carlos Florêncio 4e5f16a0b0 ci: split Claude code review into separate same-repo and fork jobs (#642) 2026-04-18 17:46:20 +01:00
Carlos Florêncio 820e0b963a ci: use Claude App token for same-repo PRs, fallback for forks (#634) 2026-04-18 11:05:47 +01:00
Carlos Florêncio 1cdfc04050 ci: pass GITHUB_TOKEN to claude-code-action to bypass OIDC exchange (#629) 2026-04-17 23:27:49 +01:00
Carlos Florêncio 1ba35225e6 ci: enable claude review on fork PRs via pull_request_target (#628) 2026-04-17 22:53:44 +01:00
Carlos Florêncio 9d88a55350 ci: allow bot-authored PRs in claude code review (#557) 2026-04-07 17:40:58 +01:00
Carlos Florêncio b6c06c337b ci: fix claude code review workflow to use oauth token and skill prompt (#553) 2026-04-06 19:19:54 +01:00
Carlos Florêncio fdeef51865 ci: add claude code github actions (#524) 2026-04-01 23:19:46 +01:00