Skip to content

Generate a PR if a newer version of micromamba is available #3893

Generate a PR if a newer version of micromamba is available

Generate a PR if a newer version of micromamba is available #3893

name: Generate a PR if a newer version of micromamba is available
on:
workflow_dispatch:
# Run every 6 hours (https://crontab.guru/every-6-hours)
schedule:
- cron: '0 */6 * * *'
jobs:
generate_pr_if_new_micromamba:
runs-on: ubuntu-22.04
steps:
- name: Checkout source
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
with:
python-version: "3.10"
- name: Check available versions
id: check_version
run: |
python -m pip install --quiet --disable-pip-version-check -r requirements.txt
CHECK_OUT="$(python check_version.py)"
LATEST_VERSION="$(echo "$CHECK_OUT" | cut -d, -f1)"
DO_PR="$(echo "$CHECK_OUT" | cut -d, -f2)"
echo "latest_version=${LATEST_VERSION}" >> $GITHUB_OUTPUT
echo "do_pr=${DO_PR}" >> $GITHUB_OUTPUT
- name: run update.sh
if: steps.check_version.outputs.do_pr == 'True'
run: ./update.sh ${{ steps.check_version.outputs.latest_version }}
- name: commit updated files
if: steps.check_version.outputs.do_pr == 'True'
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f
with:
branch: "update-${{ steps.check_version.outputs.latest_version }}"
commit-message: "Update to micromamba version ${{ steps.check_version.outputs.latest_version }}"
title: "Update to micromamba version ${{ steps.check_version.outputs.latest_version }}"
delete-branch: true