61
61
fail-fast : false
62
62
matrix :
63
63
job :
64
- - os : arm-4core-linux
64
+ - os : ubuntu-22.04-arm
65
65
image : linux-aarch64
66
66
- os : ubuntu-22.04
67
67
image : linux-x86_64
@@ -85,15 +85,37 @@ jobs:
85
85
86
86
# On pull requests, ensure that changed files are determined before checking out the code so
87
87
# that we use the GitHub API, otherwise we would have to fetch the entire history (depth: 0)
88
- - name : Get changed files
88
+ - name : Check for builder changes (pull request)
89
+ id : changed-files-pr
90
+ if : github.event_name == 'pull_request'
91
+ env :
92
+ GH_TOKEN : " ${{ github.token }}"
93
+ run : |
94
+ PR_NUMBER="${{ github.event.pull_request.number }}"
95
+ REPO="${{ github.repository }}"
96
+
97
+ BUILDERS_CHANGED=$(gh api --paginate "repos/$REPO/pulls/$PR_NUMBER/files" | \
98
+ jq -r 'map(.filename) | map(select(startswith(".builders/"))) | length > 0')
99
+
100
+ echo "builders_any_changed=$BUILDERS_CHANGED" >> $GITHUB_OUTPUT
101
+
102
+ # For push events, we still need to check changes but will rely on minimal checkout
103
+ - name : Check for builder changes (push)
104
+ id : changed-files-push
105
+ if : github.event_name != 'pull_request'
106
+ run : |
107
+ CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD)
108
+ echo "builders_any_changed=$(echo "$CHANGED_FILES" | grep -q "^\.builders/" && echo "true" || echo "false")" >> $GITHUB_OUTPUT
109
+
110
+ # Combine outputs for subsequent steps
111
+ - name : Combine changed files outputs
89
112
id : changed-files
90
- uses : tj-actions/changed-files@v42
91
- with :
92
- files_yaml : |-
93
- builders:
94
- - .builders/**
95
- dependencies:
96
- - ${{ env.DIRECT_DEPENDENCY_FILE }}
113
+ run : |
114
+ if [[ "${{ github.event_name }}" == "pull_request" ]]; then
115
+ echo "builders_any_changed=${{ steps.changed-files-pr.outputs.builders_any_changed }}" >> $GITHUB_OUTPUT
116
+ else
117
+ echo "builders_any_changed=${{ steps.changed-files-push.outputs.builders_any_changed }}" >> $GITHUB_OUTPUT
118
+ fi
97
119
98
120
- name : Checkout code
99
121
if : github.event_name == 'pull_request'
0 commit comments