From b9179623cc0469e2578865f534ea5517e847f359 Mon Sep 17 00:00:00 2001 From: Apify AI Factory Date: Wed, 2 Dec 2026 21:42:05 +0100 Subject: [PATCH 1/4] ci: update the apify-factory review workflow --- .github/workflows/factory_review.yaml | 70 ++++++++------------------- 1 file changed, 21 insertions(+), 49 deletions(-) diff --git a/.github/workflows/factory_review.yaml b/.github/workflows/factory_review.yaml index 9028c73bd..c4522ef4c 100644 --- a/.github/workflows/factory_review.yaml +++ b/.github/workflows/factory_review.yaml @@ -1,14 +1,16 @@ -name: apify-factory review (AI review, and auto-approval) +name: apify-factory review -# Calls the apify-factory review and auto-approval pipeline (apify/ai-developer, wired up in -# apify/actions). A pull request is reviewed when apify-factory is requested; with the -# repository's `factory_auto_review` custom property set to true, also every ready pull request when -# it opens and after every push that changes its content. Approvals additionally need the -# repository's `factory_auto_approve` custom property set to true. +# 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 review pipeline. Pull request code is never checked out or executed. `edited` delivers - # base changes, without which pull requests on another base are not approved. + # 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 @@ -21,56 +23,26 @@ on: - edited permissions: - contents: read pull-requests: write - # Proves to the core Actor that this run hands a review to a sandbox. id-token: write -# A push cancels the run in progress, and only the newest waiting run is kept, so an event that -# starts no job (a request or removal naming another reviewer) gets its own group, as does -# removing the bot's request. Never name a group `factory-review-` alone: it deadlocks. +# 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-${{ github.event.pull_request.number }}-${{ - startsWith(github.event.action, 'review_request') - && github.event.requested_reviewer.login != 'apify-factory' && github.run_id + 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: - factory-review: + guard: runs-on: ubuntu-latest - timeout-minutes: 60 - permissions: - contents: read - pull-requests: write - # Proves to the core Actor that this run hands a review to a sandbox. - id-token: write - # Never cancel a running review: the action posts nothing from a cancelled run, which would leave - # the request pending with no review. GitHub keeps one waiting run per group and replaces it with - # a newer one. The group differs from the workflow's own, which would otherwise wait on this job. - concurrency: - group: factory-review-job-${{ github.event.pull_request.number }} - cancel-in-progress: false + timeout-minutes: 10 steps: - - name: apify-factory review - uses: apify/actions/factory-review@v1.9.0 - with: - apify-factory-github-token: ${{ secrets.APIFY_FACTORY_GITHUB_TOKEN }} - anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY_APIFY_FACTORY_REVIEW }} - apify-factory-callback-token: ${{ secrets.APIFY_FACTORY_CALLBACK_TOKEN }} - factory-public-url: ${{ vars.FACTORY_PUBLIC_URL }} - # Paths never auto-approved here, on top of the pipeline's defaults. Proposed from the - # repository's layout when this workflow was added; edit them like any other code. - policy: | - { - "denyGlobs": [ - "src/lib/credentials.ts", - "src/lib/auth-file.ts", - "src/lib/oauth/**", - "scripts/install/**", - "skills/**", - "patches/**" - ] - } + - uses: apify/actions/factory-review@62f09e2456d6bfab33891dc37a604c67aeb98298 # v1.10.0 From 9ec511d382e1e39ddc9415bb08a8e71643af5db2 Mon Sep 17 00:00:00 2001 From: Apify AI Factory Date: Wed, 2 Dec 2026 21:42:09 +0100 Subject: [PATCH 2/4] ci: keep the apify-factory review rules in .factory --- .factory/review-policy.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .factory/review-policy.json diff --git a/.factory/review-policy.json b/.factory/review-policy.json new file mode 100644 index 000000000..1a857e11d --- /dev/null +++ b/.factory/review-policy.json @@ -0,0 +1,10 @@ +{ + "denyGlobs": [ + "src/lib/credentials.ts", + "src/lib/auth-file.ts", + "src/lib/oauth/**", + "scripts/install/**", + "skills/**", + "patches/**" + ] +} From 1b7c236eb9b67335222dbb7b158bfc967a2ee343 Mon Sep 17 00:00:00 2001 From: Apify AI Factory Date: Wed, 2 Dec 2026 21:42:11 +0100 Subject: [PATCH 3/4] ci: remove mtrunkat as code owner of the review workflow --- .github/CODEOWNERS | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 65ec1c69b..11f02ea1b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,4 +5,3 @@ /docs/*.md @szaganek /docs/*.mdx @szaganek /docs/changelog.md @szaganek -/.github/workflows/factory_review.yaml @mtrunkat From dfa00c14413df7108088796f3b39a1382af1ad66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ad=C3=A1mek?= Date: Thu, 3 Dec 2026 09:47:05 +0100 Subject: [PATCH 4/4] ci: regenerate actions.lock for the factory review workflow --- .github/workflows/actions.lock | 19 ++++++------------- .github/workflows/factory_review.yaml | 2 +- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock index fb8ee5f62..594411844 100644 --- a/.github/workflows/actions.lock +++ b/.github/workflows/actions.lock @@ -24,7 +24,7 @@ workflows: - 'actions/setup-node@v7.1.0' - 'apify/actions@v1.6.2' '.github/workflows/factory_review.yaml': - - 'apify/actions@v1.9.0' + - 'apify/actions@v1.10.0' '.github/workflows/issue_labeling.yaml': - 'actions/github-script@v9.0.0' '.github/workflows/pr_preview.yaml': @@ -67,11 +67,6 @@ dependencies: commit: 'sha1-55cc8345863c7cc4c66a329aec7e433d2d1c52a9' owner_id: 44036562 repo_id: 215566462 - 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1': - ref: 'v7.0.1' - commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1' - owner_id: 44036562 - repo_id: 197814629 'actions/checkout@v6': ref: 'v6' commit: 'sha1-d23441a48e516b6c34aea4fa41551a30e30af803' @@ -139,6 +134,11 @@ dependencies: repo_id: 496012378 uses: - 'actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f' + 'apify/actions@v1.10.0': + ref: 'v1.10.0' + commit: 'sha1-62f09e2456d6bfab33891dc37a604c67aeb98298' + owner_id: 24586296 + repo_id: 1238646352 'apify/actions@v1.6.2': ref: 'v1.6.2' commit: 'sha1-6a234394aa4b2a753d3ed294c3e069d044656406' @@ -151,13 +151,6 @@ dependencies: - 'actions/upload-artifact@v7' - 'pierotofy/set-swap-space@v1.0' - 'pnpm/action-setup@v6.1.0' - 'apify/actions@v1.9.0': - ref: 'v1.9.0' - commit: 'sha1-994a3e5ec79a5575ac4d81365bab7549c9687c32' - owner_id: 24586296 - repo_id: 1238646352 - uses: - - 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1' 'damianreeves/write-file-action@master': ref: 'master' commit: 'sha1-7d5624061f5b9d729a2acb90d4d8ea9f2f6e3ddf' diff --git a/.github/workflows/factory_review.yaml b/.github/workflows/factory_review.yaml index c4522ef4c..ecf36b0cf 100644 --- a/.github/workflows/factory_review.yaml +++ b/.github/workflows/factory_review.yaml @@ -45,4 +45,4 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: apify/actions/factory-review@62f09e2456d6bfab33891dc37a604c67aeb98298 # v1.10.0 + - uses: apify/actions/factory-review@v1.10.0