-
Notifications
You must be signed in to change notification settings - Fork 104
57 lines (52 loc) · 2.21 KB
/
update-lockfile.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Run conda-lock to update dependencies
on:
workflow_dispatch:
schedule:
# At 5:28am UTC Monday and Thursday
- cron: 28 5 * * MON,THU
jobs:
conda-lock:
# Don't run scheduled job on forks. Ref: <https://github.com/orgs/community/discussions/26684#discussioncomment-3252843>
if: (github.event_name == 'schedule' && github.repository == 'conda/conda-lock') || (github.event_name != 'schedule')
defaults:
run:
# Ensure the environment is activated
# <https://github.com/mamba-org/provision-with-micromamba#important>
shell: bash -l {0}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- name: Install Micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-file: environments/conda-lock.yml
environment-name: conda-lock-dev
- name: Install conda-lock from branch
run: pip install --editable .
- name: Run conda-lock to recreate lockfile from scratch
run: |
rm environments/conda-lock.yml
conda-lock \
--file=environments/dev-environment.yaml \
--file=pyproject.toml \
--lockfile=environments/conda-lock.yml
- name: Open a pull request
uses: peter-evans/create-pull-request@v7
with:
# # The default GITHUB_TOKEN doesn't allow other workflows to trigger.
# # Thus if there are tests to be run, they won't be run. For more info,
# # see the note under
# # <https://github.com/peter-evans/create-pull-request#action-inputs>.
# # One possible workaround is to specify a Personal Access Token (PAT).
# # This PAT should have read-write permissions for "Pull Requests"
# # and read-write permissions for "Contents".
token: ${{ secrets.GH_PAT_FOR_PR }}
commit-message: Relock dependencies
title: Relock dependencies
body: >
This pull request relocks the dependencies with conda-lock.
It is triggered by [update-lockfile](https://github.com/conda/conda-lock/blob/main/.github/workflows/update-lockfile.yaml).
branch: relock-deps
labels: conda-lock
reviewers: maresb
delete-branch: true