Skip to content

GitHub Actions to update the lockfile #8

GitHub Actions to update the lockfile

GitHub Actions to update the lockfile #8

Workflow file for this run

name: relock
# on:
# schedule:
# - cron: '0 0 1 * *'
# workflow_dispatch:
on:
pull_request:
push:
branches: [main]
jobs:
update-cftable:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@0dea6379afdaffa5d528b3d1dabc45da37f443fc # v2.0.4
with:
environment-name: RELOCK
init-shell: bash
create-args: >-
python=3
conda conda-lock
- name: re-lock
run: >
cd .binder/
&& ls -lha /home/runner/micromamba/envs/RELOCK/bin/
&& /home/runner/micromamba/envs/RELOCK/bin/conda-lock --conda=micromamba -f environment-python_and_r.yml
- name: Check for changes
id: check_changes
run: >
git diff --quiet origin/main -- ".binder/conda-lock.yml" || echo "changed=true" >> $GITHUB_OUTPUT
- name: Create PR if file changed
if: steps.check_changes.outputs.changed == 'true'
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e #v7.0.8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Update lockfile"
branch: "update-lockfile-$(date +%s)"
title: "Update lockfile"
body: "Updating the lockfile."
delete-branch: true
labels: Bot