Merge branch 'master' into fix/security-fix-7 #313
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update locked envs | |
| on: | |
| push: | |
| paths: | |
| - pixi.toml | |
| - pixi.lock | |
| schedule: | |
| - cron: "0 8 1,16 * *" # Bi-weekly | |
| workflow_dispatch: | |
| jobs: | |
| check-diff: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| has_diff: ${{ steps.check_diff.outputs.has_diff }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check pixi files diff | |
| id: check_diff | |
| run: | | |
| if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then | |
| echo "has_diff=true" >> $GITHUB_OUTPUT | |
| echo "Running on master branch - will proceed with update of lockfiles." | |
| exit 0 | |
| fi | |
| git fetch origin master | |
| if git diff origin/master...HEAD -- pixi.toml pixi.lock | grep -q .; then | |
| echo "has_diff=true" >> $GITHUB_OUTPUT | |
| echo "Differences found compared to master - will proceed with update of lockfiles." | |
| else | |
| echo "has_diff=false" >> $GITHUB_OUTPUT | |
| echo "No differences found compared to master - will skip update of lockfiles." | |
| fi | |
| update-lockfiles: | |
| needs: check-diff | |
| if: | | |
| needs.check-diff.outputs.has_diff == 'true' && | |
| ((github.event_name == 'schedule' && github.ref == 'refs/heads/master') || | |
| (github.event_name != 'schedule' && github.ref != 'refs/heads/master')) | |
| name: Update lockfiles | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup Pixi | |
| uses: prefix-dev/setup-pixi@v0.10.0 | |
| with: | |
| pixi-version: v0.68.1 | |
| - name: Full resolve | |
| run: | | |
| rm pixi.lock | |
| pixi install --all | |
| git checkout pixi.toml | |
| - name: Export conda environment files | |
| if: ${{ !vars.PYPSA_BOT_ID }} | |
| run: pixi run sync-locks | |
| - name: Create Commit | |
| if: ${{ github.ref != 'refs/heads/master' }} | |
| uses: stefanzweifel/git-auto-commit-action@v7 | |
| with: | |
| commit_message: "[github-actions.ci] Update locked envs" | |
| - name: Create Pull Request | |
| if: ${{ github.ref == 'refs/heads/master' }} | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: update-locked-environment | |
| title: "[github-actions.ci] Update locked envs" | |
| body: | | |
| Automatically generated PR to update the pixi lockfile. | |
| **Note: Do not merge without manual test execution. Either update the branch to trigger tests, or use `workflow_dispatch` to run tests manually. Unlike standard PRs, tests will not run automatically.** | |
| commit-message: "Update locked environment files for all platforms" |