From 290f15bda84b7b2be87492dfa5829737b33a53e3 Mon Sep 17 00:00:00 2001 From: Jamie Kerber Date: Fri, 5 Jun 2026 00:37:42 +0200 Subject: [PATCH] Fix build-matrix calculation - Prevents superfluous runs on scheduled runs - Fixes OS-specific workflow detection --- .github/actions/build-matrix/action.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-matrix/action.yml b/.github/actions/build-matrix/action.yml index 219b51b..3263ea8 100644 --- a/.github/actions/build-matrix/action.yml +++ b/.github/actions/build-matrix/action.yml @@ -55,12 +55,21 @@ runs: uses: tj-actions/changed-files@v45 with: files: configs/toolchain-llvm*.json + + - name: Get workflow path + id: workflow-path + shell: bash + run: | + # github.workflow_ref = "owner/repo/.github/workflows/file.yml@refs/..." + path=$(echo "${{ github.workflow_ref }}" | sed 's|[^/]*/[^/]*/||; s|@.*||') + echo "Workflow path: $path" + echo "path=$path" >> $GITHUB_OUTPUT - name: Check if workflow itself changed id: workflow-changed uses: tj-actions/changed-files@v45 with: - files: .github/workflows/ubuntu-legacy.yml + files: ${{ steps.workflow-path.outputs.path }} - name: Merge changed versions with defaults id: merge @@ -73,7 +82,7 @@ runs: const changedFiles = '${{ steps.changed-files.outputs.all_changed_files }}'; const changedVersions = []; - if (changedFiles) { + if (changedFiles && context.eventName === 'pull_request') { const files = changedFiles.split(' '); for (const file of files) { const match = file.match(/toolchain-llvm(\d+)_/);