Repository navigation
48 lines (44 loc) · 2.12 KB
/
Copy pathfactory_review.yaml
File metadata and controls
48 lines (44 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: apify-factory review
# Tells the apify-factory review pipeline (apify/ai-developer) about each pull request event: the
# factory reviews the pull request when apify-factory is requested, and, with the repository's
# `factory_auto_review` custom property set to true, every ready pull request when it opens and after
# every push that changes its content. This workflow withdraws the bot's approval whenever the
# factory says so or gives no answer. It holds no secret: its OIDC token proves which run asks.
# Approvals also need the `factory_auto_approve` custom property set to true; this repository's own
# review rules live in `.factory/review-policy.json` on the default branch.
on:
# Taken from the default branch, never from the pull request, so a pull request cannot rewrite
# its own guard. Pull request code is never checked out or executed. `edited` delivers base
# changes, without which pull requests on another base are not approved.
pull_request_target:
types:
- opened
- reopened
- review_requested
- review_request_removed
- converted_to_draft
- ready_for_review
- synchronize
- edited
permissions:
pull-requests: write
id-token: write
# A push cancels the run in progress, since the newer run judges the pull request as it now
# stands. The events the guard passes over (a request or removal naming another reviewer, an edit
# that keeps the base) and the bot's request being removed get groups of their own, so that none
# of them takes the place of a waiting run that matters.
concurrency:
group: >-
factory-review-guard-${{ github.event.pull_request.number }}-${{
(startsWith(github.event.action, 'review_request')
&& github.event.requested_reviewer.login != 'apify-factory'
|| github.event.action == 'edited' && !github.event.changes.base) && github.run_id
|| github.event.action == 'review_request_removed' && 'withdraw'
|| 'events' }}
cancel-in-progress: ${{ github.event.action == 'synchronize' }}
jobs:
guard:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: apify/actions/factory-review@v1.10.0