diff --git a/.github/workflows/claude-review.yml b/.github/workflows/claude-review.yml new file mode 100644 index 000000000..9a9b31b8f --- /dev/null +++ b/.github/workflows/claude-review.yml @@ -0,0 +1,38 @@ +name: Claude Review + +# Claude reviews a pull request at most 2 times, in the policy of +# fintermobilityas/company (docs/pull-requests.md). Round 1 starts when a pull +# request opens or leaves draft. Round 2, and every review of a fork's pull +# request, starts only when a maintainer adds the `claude-review` label. +# +# Keep this file identical in every repository and change the review itself in +# fintermobilityas/review/.github/workflows/claude-review.yml, which this file +# calls at a commit of that repository: a change there reaches this repository +# only when this line moves. + +on: + pull_request_target: + types: [opened, reopened, ready_for_review, labeled] + +permissions: + contents: read + +jobs: + review: + if: github.event.action != 'labeled' || github.event.label.name == 'claude-review' + # A new run waits for the current one and never cancels it, so the label stays + # until its own run removes it and two runs cannot count the same free round. + concurrency: + group: claude-review-${{ github.event.pull_request.number }} + cancel-in-progress: false + uses: fintermobilityas/review/.github/workflows/claude-review.yml@a00561c601744f1e43aa9457553f902574809e7a + permissions: + contents: read + pull-requests: write + issues: write + actions: read + checks: read + statuses: read + # The called workflow reads ANTHROPIC_API_KEY, the organization secret. + secrets: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}