From 772e06bd9e1e6e94525ab8f490c302eba863b374 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 14 Jul 2026 17:53:09 +0200 Subject: [PATCH 1/2] Skip the rebuild when rector-src main is a release tag commit A tagged main is already published by the tag build of rector-src. A dispatched build would race that build for the push to rectorphp/rector, and the loser of the race fails on a non fast forward push. Tags are resolved with git ls-remote, which lists a lightweight tag with the commit itself and an annotated tag with an extra "^{}" line, so both kinds are matched. rector-src has 36 annotated tags among 574. --- .../dispatch_build_scoped_rector.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/dispatch_build_scoped_rector.yaml b/.github/workflows/dispatch_build_scoped_rector.yaml index 2abe4ba4..8ca35aa7 100644 --- a/.github/workflows/dispatch_build_scoped_rector.yaml +++ b/.github/workflows/dispatch_build_scoped_rector.yaml @@ -15,8 +15,29 @@ jobs: runs-on: ubuntu-latest steps: + # a tagged main is already being published by the tag build of rector-src, + # dispatching a second build would race it for the push to rectorphp/rector + - + name: "Check whether rector-src main is a release tag commit" + id: release_tag + run: | + RECTOR_SRC="https://github.com/rectorphp/rector-src.git" + + MAIN_SHA=$(git ls-remote $RECTOR_SRC refs/heads/main | cut -f1) + if [ -z "$MAIN_SHA" ]; then + echo "Could not resolve rector-src main" + exit 1 + fi + + # lightweight tags are listed with the commit itself, annotated ones with a "^{}" line + if git ls-remote --tags $RECTOR_SRC | grep -q "^${MAIN_SHA}"; then + echo "rector-src main $MAIN_SHA is tagged, leaving the build to the tag itself" + echo "tagged=true" >> $GITHUB_OUTPUT + fi + - name: "Trigger build_scoped_rector.yaml in rectorphp/rector-src" + if: steps.release_tag.outputs.tagged != 'true' env: GH_TOKEN: ${{ secrets.ACCESS_TOKEN }} run: gh workflow run build_scoped_rector.yaml --repo rectorphp/rector-src --ref main From d5a98482f0e57b4ab801877bdb8c29557d6f7869 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Fri, 24 Jul 2026 11:14:46 +0200 Subject: [PATCH 2/2] Remove StructArmed Drop boundwize/structarmed dev dependency, its config, and CI step. --- .github/workflows/code_analysis.yaml | 4 ---- composer.json | 1 - structarmed.php | 9 --------- 3 files changed, 14 deletions(-) delete mode 100644 structarmed.php diff --git a/.github/workflows/code_analysis.yaml b/.github/workflows/code_analysis.yaml index b161284d..7a9374bc 100644 --- a/.github/workflows/code_analysis.yaml +++ b/.github/workflows/code_analysis.yaml @@ -36,10 +36,6 @@ jobs: name: 'Tests' run: vendor/bin/phpunit - - - name: 'Run StructArmed' - run: vendor/bin/structarmed analyze - name: ${{ matrix.actions.name }} runs-on: ubuntu-latest timeout-minutes: 10 diff --git a/composer.json b/composer.json index f3c1b459..62d04d2c 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,6 @@ "php": ">=8.4" }, "require-dev": { - "boundwize/structarmed": "^0.14", "phpstan/extension-installer": "^1.4", "phpstan/phpstan": "^2.1.38", "phpstan/phpstan-deprecation-rules": "^2.0", diff --git a/structarmed.php b/structarmed.php deleted file mode 100644 index 2cd501fd..00000000 --- a/structarmed.php +++ /dev/null @@ -1,9 +0,0 @@ -withPreset(Preset::PSR4());