Skip to content

relock

relock #12

Workflow file for this run

name: relock
# no permissions by default
permissions: {}
on:
schedule:
- cron: '0 0 1 * *'
workflow_dispatch:
jobs:
relock:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@add3a49764cedee8ee24e82dfde87f5bc2914462 # v2.0.7
with:
environment-name: RELOCK
init-shell: bash
create-args: >-
python=3
conda conda-lock
- name: re-lock
run: >
cd .binder/
&& 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