-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (39 loc) · 1.17 KB
/
update-time.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 and Commit
on:
schedule:
- cron: '0 0 * * *' # 毎日0時に実行
push:
branches:
- main # mainブランチにプッシュされたときに実行
workflow_dispatch: # 手動での実行も許可
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: main # メインブランチをチェックアウト
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies
run: |
npm install -g pnpm
pnpm i
- name: Run update script
run: node update.js
- name: Commit changes
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Update results from update.js"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main # プッシュ先のブランチを指定