-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (43 loc) · 1.63 KB
/
update_submodule.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
name: Update data submodule
on:
schedule:
# Run daily at midnight
- cron: 0 0 * * *
workflow_dispatch:
jobs:
update-submodule:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.CLIMATE_DB_DATA_PAT }}
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Update submodule
run: |
git submodule update --remote -- data
output=$(git status -s data)
echo "$output"
# Check if the status output is non-empty
if [[ -n "$output" ]]; then
./code/create_prerendered_figures.py
fi
- name: Create pull request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.CLIMATE_DB_DATA_PAT }}
commit-message: '[create-pull-request] update data submodule'
title: '[BOT] Update data submodule'
body: |
This PR updates the data submodule to the latest commit.
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
base: main
branch: create-pull-request/bump-data-submodule