forked from PyPSA/pypsa-eur
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 1.33 KB
/
update-fixed-env.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Fixed-Version Environment Checker
on:
push:
branches:
- master
paths:
- 'envs/environment.yaml'
jobs:
update-environment-fixed:
name: Update environment.fixed.yaml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: ${{ github.event.repository.name }}
environment-file: envs/environment.yaml
- name: Update environment.fixed.yaml
run: |
conda env export --name ${{ github.event.repository.name }} --no-builds | sed 's/^name: ${{ github.event.repository.name }}$/name: ${{ github.event.repository.name }}-fixed/' > envs/environment.fixed.yaml
- name: Add SPDX header
run: |
SPDX_HEADER="# SPDX-FileCopyrightText: : 2017-2024 The PyPSA-Eur Authors\n# SPDX-License-Identifier: CC0-1.0\n"
echo -e "$SPDX_HEADER" | cat - envs/environment.fixed.yaml > temp && mv temp envs/environment.fixed.yaml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update-environment-fixed
title: "[github-actions.ci] Update fixed environment"
body: Automatically generated PR to update environment.fixed.yaml, since environment.yaml was updated.