-
Notifications
You must be signed in to change notification settings - Fork 7
69 lines (58 loc) · 1.65 KB
/
update_readme.yml
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Update README.md
on:
workflow_dispatch:
workflow: "*"
schedule:
# Run at midnight on each Saturday
- cron: '0 0 * * 6'
# Don't run on pull_request because it is not easy to make it secure
push:
paths:
- 'extension_list.txt'
- 'readme_source/**'
- 'make_README.py'
branches:
- '*'
jobs:
update_readme:
runs-on: ubuntu-latest
permissions:
contents: write
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
# use base environment, so that when using pip, this is from the
# miniforge distribution
auto-activate-base: true
activate-environment: ""
- name: Conda info
run: |
conda info
conda list
- name: Install extensions
run: |
mamba install --file extension_list.txt
- name: Conda list
run: |
conda list
- name: Update README.md
run: |
python make_README.py
- name: Git status
run: |
git status
# Get the exit code of the last command and save it to the COMMIT_REQUIRED variable
echo "COMMIT_REQUIRED=$(git diff --quiet --exit-code || echo $?)" >> $GITHUB_ENV
- name: Push changes to Github
if: ${{ env.COMMIT_REQUIRED == 1 }}
run: |
git config --global user.name "Automatic README update"
git config --global user.email "[email protected]"
git add .
git commit -m "Update README.md"
git push