|
| 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