File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -515,27 +515,25 @@ jobs:
515515 ref : ${{ github.head_ref || github.ref }}
516516 repository : ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
517517
518- - name : Prepare
519- id : prepare
520- run : |
521- if [ -d .ci-package-locks ]; then
522- echo "LOCKS_EXIST=true" >> "$GITHUB_OUTPUT"
523- else
524- echo "LOCKS_EXIST=false" >> "$GITHUB_OUTPUT"
525- fi
526-
527518 - uses : actions/download-artifact@v4
528- if : github.event_name == 'schedule' || steps.prepare.outputs.LOCKS_EXIST == 'false'
529519 with :
530520 pattern : ci-package-locks-*
531521 merge-multiple : true
532522
533- - name : Update CI package locks
534- if : github.event_name == 'schedule' || steps.prepare.outputs.LOCKS_EXIST == 'false'
523+ - name : Prepare
524+ id : prepare
525+ # We check if lock files have changed. This should only be the case if we are either running on a schedule
526+ # or if some lock files did not exist yet.
535527 run : |
536528 git config user.name 'github-actions[bot]'
537529 git config user.email 'github-actions[bot]@users.noreply.github.com'
538530
531+ git add -N .ci-package-locks
532+ git diff --quiet || echo "HAS_DIFF=true" >> "$GITHUB_OUTPUT"
533+
534+ - name : Update CI package locks
535+ if : steps.prepare.outputs.HAS_DIFF == 'true'
536+ run : |
539537 git add .ci-package-locks
540538 git commit -m "Update CI package locks"
541539 git push
You can’t perform that action at this time.
0 commit comments