download and commit #256
This file contains 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: download and commit | |
on: | |
schedule: | |
- cron: '0 10 * * *' # 1日1回 UTCでの10時に | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
- name: Install dependencies | |
run: | | |
pip install pandas openpyxl | |
- name: Copy byouin_list | |
run: | | |
curl -o data/byouin_list/org/byouin_list.xlsx "https://www.city.kumamoto.jp/opendata/pub/byouin_list.xlsx" | |
python script/xls2csv.py data/byouin_list/org/byouin_list.xlsx | |
- name: Copy yakkyoku_list | |
run: | | |
curl -o data/yakkyoku_list/org/yakkyoku_list.xlsx "https://www.city.kumamoto.jp/opendata/pub/yakkyoku_list.xlsx" | |
python script/xls2csv.py data/yakkyoku_list/org/yakkyoku_list.xlsx | |
- name: Copy tennpohannbaigyou_list | |
run: | | |
curl -o data/tennpohannbaigyou_list/org/tennpohannbaigyou_list.xlsx "https://www.city.kumamoto.jp/opendata/pub/tennpohannbaigyou_list.xlsx" | |
python script/xls2csv.py data/tennpohannbaigyou_list/org/tennpohannbaigyou_list.xlsx | |
- name: Copy Insyokutenneigyoukyoka | |
run: curl -o data/Insyokutenneigyoukyoka/org/Insyokutenneigyoukyoka.csv "https://www.city.kumamoto.jp/opendata/pub/Insyokutenneigyoukyoka.csv" | |
- name: Copy ShinnkiInsyokutenneigyoukyoka | |
run: | | |
curl -o data/Insyokutenneigyoukyoka/org/ShinnkiInsyokutenneigyoukyoka.xlsx "https://www.city.kumamoto.jp/opendata/pub/ShinnkiInsyokutenneigyoukyoka.xlsx" | |
python script/xls2csv.py data/Insyokutenneigyoukyoka/org/ShinnkiInsyokutenneigyoukyoka.xlsx | |
head -2 data/Insyokutenneigyoukyoka/org/ShinnkiInsyokutenneigyoukyoka.csv | |
- name: Commit files | |
run: | | |
git config --local user.useConfigOnly false | |
git config --local user.name "Scraping Bot" | |
git config --local user.email "[email protected]" | |
git status | |
git add . | |
git commit -v -m "[Bot] GitHub Actions - get data at $(date +'%Y-%m-%d')" || echo "No changes to commit" | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v3 |