Skip to content

Commit 2687ea0

Browse files
committed
Remove use of compromised action
1 parent d881aea commit 2687ea0

File tree

1 file changed

+31
-9
lines changed

1 file changed

+31
-9
lines changed

.github/workflows/build-deps.yml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
fail-fast: false
6262
matrix:
6363
job:
64-
- os: arm-4core-linux
64+
- os: ubuntu-22.04-arm
6565
image: linux-aarch64
6666
- os: ubuntu-22.04
6767
image: linux-x86_64
@@ -85,15 +85,37 @@ jobs:
8585

8686
# On pull requests, ensure that changed files are determined before checking out the code so
8787
# 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
89112
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
97119
98120
- name: Checkout code
99121
if: github.event_name == 'pull_request'

0 commit comments

Comments
 (0)