From cea4a748815e328ea68191700fb57fe890363425 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Wed, 26 Aug 2026 18:50:14 +0100 Subject: [PATCH 1/2] [CI] Fire scoped-rector dispatch on merged PR, not push --- .../workflows/dispatch_build_scoped_rector.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dispatch_build_scoped_rector.yaml b/.github/workflows/dispatch_build_scoped_rector.yaml index 2391f54b..b475fce0 100644 --- a/.github/workflows/dispatch_build_scoped_rector.yaml +++ b/.github/workflows/dispatch_build_scoped_rector.yaml @@ -2,23 +2,25 @@ # with the freshly merged rector-downgrade-php main name: Dispatch Build Scoped Rector +# pull_request_target fires on merge even for fork PRs and, unlike "push", +# is not suppressed when the merge commit is pushed with GITHUB_TOKEN on: - push: - branches: - - main + pull_request_target: + types: + - closed workflow_dispatch: null jobs: dispatch_build_scoped_rector: - # only for this repository, not forks - if: github.repository == 'rectorphp/rector-downgrade-php' + # only for this repository, not forks; and only on a merged PR (not a plain close) + if: github.repository == 'rectorphp/rector-downgrade-php' && (github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true) runs-on: ubuntu-latest timeout-minutes: 10 steps: - - name: "Wait 20 seconds after push" + name: "Wait 20 seconds after merge" run: sleep 20 - From a65a4bdd706faa896cfd6de3085f7ba5af5735d1 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Wed, 26 Aug 2026 18:58:56 +0100 Subject: [PATCH 2/2] [CI] Shorten dispatch settle wait to 10s --- .github/workflows/dispatch_build_scoped_rector.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dispatch_build_scoped_rector.yaml b/.github/workflows/dispatch_build_scoped_rector.yaml index b475fce0..5177eed9 100644 --- a/.github/workflows/dispatch_build_scoped_rector.yaml +++ b/.github/workflows/dispatch_build_scoped_rector.yaml @@ -20,8 +20,8 @@ jobs: steps: - - name: "Wait 20 seconds after merge" - run: sleep 20 + name: "Wait 10 seconds after merge" + run: sleep 10 - name: "Check whether rector-src main is a release tag commit"