Skip to content

Update and Commit

Update and Commit #209

Workflow file for this run

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 # プッシュ先のブランチを指定