Skip to content

Commit

Permalink
ci: update missing ci lock files when not running on scheudle
Browse files Browse the repository at this point in the history
  • Loading branch information
iisakkirotko committed Apr 9, 2024
1 parent 37805a2 commit e659618
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -515,27 +515,25 @@ jobs:
ref: ${{ github.head_ref || github.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}

- name: Prepare
id: prepare
run: |
if [ -d .ci-package-locks ]; then
echo "LOCKS_EXIST=true" >> "$GITHUB_OUTPUT"
else
echo "LOCKS_EXIST=false" >> "$GITHUB_OUTPUT"
fi
- uses: actions/download-artifact@v4
if: github.event_name == 'schedule' || steps.prepare.outputs.LOCKS_EXIST == 'false'
with:
pattern: ci-package-locks-*
merge-multiple: true

- name: Update CI package locks
if: github.event_name == 'schedule' || steps.prepare.outputs.LOCKS_EXIST == 'false'
- name: Prepare
id: prepare
# We check if lock files have changed. This should only be the case if we are either running on a schedule
# or if some lock files did not exist yet.
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add -n .ci-package-locks
git diff --quiet || echo "HAS_DIFF=true" >> "$GITHUB_OUTPUT"
- name: Update CI package locks
if: steps.prepare.outputs.HAS_DIFF == 'true'
run: |
git add .ci-package-locks
git commit -m "Update CI package locks"
git push
Expand Down

0 comments on commit e659618

Please sign in to comment.