Skip to content

Commit 19bbca8

Browse files
committed
ci: update missing ci lock files when not running on schedule
1 parent 37805a2 commit 19bbca8

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

.github/workflows/test.yaml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)