Skip to content

Commit 919cb60

Browse files
Merge pull request #410 from MetOffice/409_workflow_conda_lock
Update workflow conda lockfiles automatically
2 parents 8054a66 + ad925ea commit 919cb60

File tree

5 files changed

+236
-389
lines changed

5 files changed

+236
-389
lines changed

.github/workflows/conda-lock.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ jobs:
2626
run: conda update -q conda
2727

2828
- name: Hash existing lock files
29-
run: sha256sum **/locks/*.txt > ${{ runner.temp }}/lock_file_hashes
29+
run: |
30+
shopt -s globstar
31+
sha256sum **/locks/*.txt > ${{ runner.temp }}/lock_file_hashes
32+
cat ${{ runner.temp }}/lock_file_hashes
3033
3134
- name: Switch branch
3235
run: |
@@ -52,13 +55,15 @@ jobs:
5255
env:
5356
GH_TOKEN: ${{ github.token }}
5457
run: |
58+
shopt -s globstar
59+
git diff --name-status
5560
if $(sha256sum --status -c ${{ runner.temp }}/lock_file_hashes); then
5661
echo "Lock files unchanged. Skipping pull request..."
5762
exit 0
5863
fi
5964
# Update lock_file_hashes so pushed branch name is unique.
6065
sha256sum **/locks/*.txt > ${{ runner.temp }}/lock_file_hashes
61-
git add requirements/locks/*.txt
66+
git add **/locks/*.txt
6267
git commit -m "[CI] Update conda lock files"
6368
git push --set-upstream origin "conda-lock-files:conda-lock-$(sha256sum ${{ runner.temp }}/lock_file_hashes | head -c 8)"
6469
# Create PR on GitHub using GitHub CLI.

0 commit comments

Comments
 (0)