Skip to content

update-conda-lockfile #452

update-conda-lockfile

update-conda-lockfile #452

---
name: update-conda-lockfile
on:
workflow_dispatch:
schedule:
- cron: "0 9 * * 1" # Mondays at 9AM UTC
# What branch does this action run on?
# - workflow_dispatch: Whatever branch it was run against.
# - schedule: Always the same branch (will be dev or main)
jobs:
update-conda-lockfile:
runs-on: ubuntu-latest
if: (github.event_name == 'schedule' && github.repository == 'catalyst-cooperative/pudl') || (github.event_name == 'workflow_dispatch') }}

Check failure on line 16 in .github/workflows/update-conda-lockfile.yml

View workflow run for this annotation

GitHub Actions / update-conda-lockfile

Invalid workflow file

The workflow is not valid. .github/workflows/update-conda-lockfile.yml (Line: 16, Col: 9): Unexpected symbol: '}}'. Located at position 133 within expression: (github.event_name == 'schedule' && github.repository == 'catalyst-cooperative/pudl') || (github.event_name == 'workflow_dispatch') }}
defaults:
run:
shell: bash -l {0}
steps:
- name: Get today's date
run: |
echo "TODAY=$(date +%Y-%m-%d)" >> $GITHUB_ENV
- name: Set GITHUB_REF for use with workflow_dispatch
if: ${{ (github.event_name == 'workflow_dispatch') }}
run: |
echo "GITHUB_REF="${{ github.ref_name }} >> $GITHUB_ENV
- name: Set GITHUB_REF for use with schedule
if: ${{ (github.event_name == 'schedule') }}
run: |
echo "GITHUB_REF=dev" >> $GITHUB_ENV
- name: Log final value of GITHUB_REF
run: |
echo "Final GITHUB_REF:" ${{ env.GITHUB_REF }}
- uses: actions/checkout@v4
with:
token: ${{ secrets.PUDL_BOT_PAT }}
ref: ${{ env.GITHUB_REF }}
- name: Install Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-name: conda-lock
create-args: >-
python=3.11
conda-lock>=2.5.1
prettier
- name: Run conda-lock to recreate lockfile from scratch
run: |
make conda-clean
make conda-lock.yml
- name: Make a PR to merge updated conda lockfiles
# If we are relocking dependencies on a schedule or workflow_dispatch, we need
# to make our own PR to check whether the updated environment actually solves
# and the tests pass.
if: ${{ (github.event_name == 'schedule' && github.repository == 'catalyst-cooperative/pudl') || (github.event_name == 'workflow_dispatch') }}
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.PUDL_BOT_PAT }}
commit-message: "Update conda-lock.yml and rendered conda environment files."
title: Update conda lockfile for week of ${{ env.TODAY }}
body: >
This pull request relocks the dependencies with conda-lock.
It is triggered by [update-conda-lockfile](https://github.com/catalyst-cooperative/pudl/blob/main/.github/workflows/update-conda-lockfile.yml).
labels: dependencies, conda-lock
reviewers: zaneselvans
branch: update-conda-lockfile
base: ${{ env.GITHUB_REF }}
delete-branch: true