forked from Tokyo-Metro-Gov/covid19
-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (65 loc) · 2.03 KB
/
convert.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
69
70
71
72
73
74
75
76
77
78
name: Renew data
on:
workflow_dispatch:
schedule:
- cron: '30 14 * * *'
env:
TZ: Asia/Tokyo
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v3
with:
python-version: '3.7'
architecture: x64
- name: Install dependency
run: pip install -r requirements.txt
working-directory: ./tool
- name: Convert
run: python ../tool/covid19_chibashi_convert_php.py
working-directory: ./data
env:
SERVICE_ACCOUNT_JSON: ${{ secrets.SERVICE_ACCOUNT_JSON }}
- name: Git add & commit
run: |
git config --local user.email "${{ secrets.EMAIL }}"
git config --local user.name "${{ secrets.NAME }}"
git status | grep "data.json" && git add data/data.json \
&& git commit -m "update data.json: `date +'%Y-%m-%d %H:%M:%S'`"
- name: Set variables
id: update_data
run: |
date=$(date +'%m/%d')
echo "::set-output name=date::$date"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
title: 受領データの反映(${{ steps.update_data.outputs.date }})
branch: feature/update-data
labels: automerge
- name: Auto Approve
uses: hmarr/auto-approve-action@v2
with:
github-token: ${{ secrets.PAT }}
pull-request-number: ${{ env.PULL_REQUEST_NUMBER }}
- name: Auto Merge
uses: pascalgn/automerge-action@v0.14.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_DELETE_BRANCH: true
MERGE_RETRIES: "10"
MERGE_RETRY_SLEEP: "60000"
- name: Notify to slack
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: Renew Data
fields: repo,commit,action,ref,author,workflow
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: ${{ failure() }}