Skip to content

Commit 88e6164

Browse files
committed
CI: fix bump after update
1 parent 50d8daa commit 88e6164

File tree

1 file changed

+43
-3
lines changed

1 file changed

+43
-3
lines changed

.github/workflows/update.yml

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ jobs:
131131
echo "Base branch: ${{ needs.new-branch.outputs.base }}"
132132
echo "Working branch: ${{ needs.new-branch.outputs.working }}"
133133
134-
- uses: actions/checkout@v4
134+
- name: Checkout
135+
uses: actions/checkout@v4
135136
with:
136137
ref: ${{ needs.new-branch.outputs.working }}
137138

@@ -224,11 +225,49 @@ jobs:
224225
echo "Pushed: ${{ steps.commit.outputs.pushed }}"
225226
echo "SHA: ${{ steps.commit.outputs.commit_sha }}"
226227
228+
changes:
229+
name: Changes
230+
needs: [new-branch, pre-gen]
231+
runs-on: ubuntu-latest
232+
steps:
233+
- name: Checkout
234+
uses: actions/checkout@v4
235+
with:
236+
ref: ${{ needs.new-branch.outputs.working }}
237+
fetch-depth: 10
238+
239+
# Maybe better just checkout and then
240+
# git rev-list --ancestry-path ${{ needs.new-branch.outputs.base || github.event.repository.default_branch }}..${{ needs.new-branch.outputs.working }}
241+
# It's faster, simplier and less deps.
242+
- name: Changes
243+
id: changes
244+
continue-on-error: true
245+
uses: tj-actions/changed-files@v44
246+
with:
247+
skip_initial_fetch: "false"
248+
sha: ${{ needs.new-branch.outputs.working }}
249+
base_sha: ${{ needs.new-branch.outputs.base || github.event.repository.default_branch }}
250+
251+
- name: List changed files
252+
if: steps.changes.outcome == 'success'
253+
env:
254+
ALL_CHANGED_FILES: ${{ steps.changes.outputs.all_changed_files }}
255+
run: |
256+
for file in ${ALL_CHANGED_FILES}; do
257+
echo "$file was changed"
258+
done
259+
260+
outputs:
261+
changes: ${{ steps.changes.outputs.all_changed_files }}
262+
changed: ${{ steps.changes.outputs.all_changed_files && 'true' || ' ' }}
263+
264+
227265
bump:
228266
name: Bump
229-
needs: [new-branch, pre-gen]
267+
needs: [new-branch, pre-gen, changes]
230268
runs-on: ubuntu-latest
231269
continue-on-error: true # Workspaces are not supported yet
270+
if: needs.changes.outputs.changed == 'true'
232271
defaults:
233272
run:
234273
shell: bash
@@ -307,7 +346,8 @@ jobs:
307346

308347
tests:
309348
name: Tests
310-
needs: [new-branch, pre-gen]
349+
needs: [new-branch, pre-gen, changes]
350+
if: needs.changes.outputs.changed == 'true'
311351
uses: ./.github/workflows/tests.yml
312352
secrets: inherit
313353
permissions:

0 commit comments

Comments
 (0)