Skip to content

Commit e7ce550

Browse files
committed
chore(ci): Add workflow to update pixi lock on PRs
1 parent a1c53ad commit e7ce550

File tree

2 files changed

+56
-17
lines changed

2 files changed

+56
-17
lines changed

.github/workflows/docker.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,6 @@ env:
1818
FORCE_COLOR: true
1919

2020
jobs:
21-
check-pixi:
22-
runs-on: ubuntu-latest
23-
permissions:
24-
contents: read
25-
steps:
26-
- name: Checkout repository
27-
uses: actions/checkout@v5
28-
with:
29-
fetch-depth: 200
30-
fetch-tags: true
31-
ref: ${{ github.ref }}
32-
- uses: prefix-dev/[email protected]
33-
with:
34-
pixi-version: v0.55.0
35-
run-install: false
36-
- run: pixi lock --check
37-
3821
build-container:
3922
runs-on: ubuntu-latest
4023
permissions:

.github/workflows/pixi-lock.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
on:
2+
pull_request_target:
3+
paths:
4+
- pyproject.toml
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
check-lockfile:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
steps:
16+
- name: Checkout pull request
17+
uses: actions/checkout@v5
18+
with:
19+
ref: ${{ github.event.pull_request.head.sha }}
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
fetch-depth: 0
22+
- name: Find submitting repository
23+
id: get-source-repo
24+
uses: actions/github-script@v8
25+
env:
26+
OWNER: ${{ github.repository_owner }}
27+
REPO: ${{ github.repository }}
28+
PULL: ${{ github.event.number }}
29+
with:
30+
script: |
31+
const { data } = await github.rest.pulls.get({
32+
owner: process.env.OWNER,
33+
repo: process.env.REPO.split('/')[1],
34+
pull_number: process.env.PULL,
35+
});
36+
core.setOutput('remote', data.head.repo.html_url)
37+
core.setOutput('branch', data.head.ref)
38+
- name: Set git identity
39+
run: |
40+
git config --global user.name "nipreps[bot]"
41+
git config --global user.email "[email protected]"
42+
- uses: prefix-dev/[email protected]
43+
with:
44+
pixi-version: v0.58.0
45+
run-install: false
46+
- name: Install the latest version of uv
47+
uses: astral-sh/setup-uv@v7
48+
- name: Update lockfile
49+
run: |
50+
uvx datalad run -i pixi.lock -i pyproject.toml -o pixi.lock -- pixi lock
51+
- name: Push updated lockfile, if needed
52+
run: |
53+
git push $REMOTE HEAD:$BRANCH
54+
env:
55+
REMOTE: ${{ steps.get-source-repo.outputs.remote }}
56+
BRANCH: ${{ steps.get-source-repo.outputs.branch }}

0 commit comments

Comments
 (0)