-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (36 loc) · 1.14 KB
/
update_my_til.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
name: UpdateMyTIL
on:
# 手動でもWorkflowを利用できるようにしておく
workflow_dispatch:
schedule:
# JSTで8:45に1週間に1回実行
- cron: "45 23 * * 0"
jobs:
output_study_history:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Run index.py
run: |
python index.py
- name: Commit and Push diff
env:
# コマンドを実行するための環境変数をセット
GIT_USER: ${{ secrets.GIT_USER }}
GIT_MAIL: ${{ secrets.GIT_MAIL }}
run: |
# git remote set-url origin https://github.com/${GIT_USER}/til
git config --global user.name "${GIT_USER}"
git config --global user.email "${GIT_MAIL}"
if (git diff --shortstat | grep '[0-9]'); then \
git add .; \
git commit -m 'Updated TIL repository regularly!!'; \
git push origin HEAD; \
fi