From 78d77f952272b428843242a2801f2a0d8d994406 Mon Sep 17 00:00:00 2001 From: Akash Sinha Date: Wed, 17 Jun 2026 12:48:35 +0530 Subject: [PATCH] =?UTF-8?q?Revert=20"ci:=20skip=20heavy=20suites=20on=20ve?= =?UTF-8?q?rsion-bump=20PRs=20via=20paths-ignore=20(PER-9560)=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f3c7a13b1ed4139408e9cde1019008375edb43e2. --- .github/workflows/test.yml | 45 +++++++++++++++++++++++++++++++---- .github/workflows/windows.yml | 42 ++++++++++++++++++++++++++++---- 2 files changed, 78 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d9a2bd136..e64b638a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,13 +3,46 @@ on: push: branches: [master] pull_request: - paths-ignore: - - 'lerna.json' - - 'packages/*/package.json' workflow_dispatch: + +permissions: + contents: read + pull-requests: read + jobs: + changes: + name: Detect version-only changes + runs-on: ubuntu-latest + outputs: + version_only: ${{ steps.filter.outputs.version_only }} + steps: + - name: Check the PR changes only version files + id: filter + if: github.event_name == 'pull_request' + env: + GH_TOKEN: ${{ github.token }} + PR: ${{ github.event.pull_request.number }} + REPO: ${{ github.repository }} + run: | + if ! files=$(gh api "repos/$REPO/pulls/$PR/files" --paginate --jq '.[].filename'); then + echo "Could not list PR files — running full CI to be safe." + echo "version_only=false" >> "$GITHUB_OUTPUT" + exit 0 + fi + printf 'Changed files:\n%s\n' "$files" + # version_only=true only if EVERY changed file is lerna.json or a top-level + # packages//package.json (exactly what version-bump.yml commits). + others=$(printf '%s\n' "$files" | grep -vE '^(lerna\.json|packages/[^/]+/package\.json)$' || true) + if [ -n "$files" ] && [ -z "$others" ]; then + echo "version_only=true" >> "$GITHUB_OUTPUT" + else + echo "version_only=false" >> "$GITHUB_OUTPUT" + fi + build: name: Build + needs: [changes] + if: ${{ !(startsWith(github.head_ref, 'release/') && github.event.pull_request.user.login == 'github-actions[bot]' && needs.changes.outputs.version_only == 'true') }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 @@ -38,7 +71,8 @@ jobs: test: name: Test ${{ matrix.package }} - needs: [build] + needs: [build, changes] + if: ${{ !(startsWith(github.head_ref, 'release/') && github.event.pull_request.user.login == 'github-actions[bot]' && needs.changes.outputs.version_only == 'true') }} strategy: matrix: os: [ubuntu-latest] @@ -140,7 +174,8 @@ jobs: regression: name: Regression - needs: [build] + needs: [build, changes] + if: ${{ !(startsWith(github.head_ref, 'release/') && github.event.pull_request.user.login == 'github-actions[bot]' && needs.changes.outputs.version_only == 'true') }} runs-on: ubuntu-latest timeout-minutes: 15 steps: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6a914b75d..026ed0e30 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -3,13 +3,46 @@ on: push: branches: [master] pull_request: - paths-ignore: - - 'lerna.json' - - 'packages/*/package.json' workflow_dispatch: + +permissions: + contents: read + pull-requests: read + jobs: + changes: + name: Detect version-only changes + runs-on: ubuntu-latest + outputs: + version_only: ${{ steps.filter.outputs.version_only }} + steps: + - name: Check the PR changes only version files + id: filter + if: github.event_name == 'pull_request' + env: + GH_TOKEN: ${{ github.token }} + PR: ${{ github.event.pull_request.number }} + REPO: ${{ github.repository }} + run: | + if ! files=$(gh api "repos/$REPO/pulls/$PR/files" --paginate --jq '.[].filename'); then + echo "Could not list PR files — running full CI to be safe." + echo "version_only=false" >> "$GITHUB_OUTPUT" + exit 0 + fi + printf 'Changed files:\n%s\n' "$files" + # version_only=true only if EVERY changed file is lerna.json or a top-level + # packages//package.json (exactly what version-bump.yml commits). + others=$(printf '%s\n' "$files" | grep -vE '^(lerna\.json|packages/[^/]+/package\.json)$' || true) + if [ -n "$files" ] && [ -z "$others" ]; then + echo "version_only=true" >> "$GITHUB_OUTPUT" + else + echo "version_only=false" >> "$GITHUB_OUTPUT" + fi + build: name: Build + needs: [changes] + if: ${{ !(startsWith(github.head_ref, 'release/') && github.event.pull_request.user.login == 'github-actions[bot]' && needs.changes.outputs.version_only == 'true') }} runs-on: windows-latest steps: - uses: actions/checkout@v5 @@ -38,7 +71,8 @@ jobs: test: name: Test ${{ matrix.package }} - needs: [build] + needs: [build, changes] + if: ${{ !(startsWith(github.head_ref, 'release/') && github.event.pull_request.user.login == 'github-actions[bot]' && needs.changes.outputs.version_only == 'true') }} strategy: fail-fast: false matrix: