update #533
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: update | |
on: | |
workflow_dispatch: | |
schedule: | |
# 日本時間の深夜0時 | |
- cron: '0 15 * * *' | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set branch name as environment variable | |
run: echo "NEW_BRANCH_NAME=update-list-$(date '+%s')" >> $GITHUB_ENV | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- name: Create new branch | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git switch -c ${{ env.NEW_BRANCH_NAME }} | |
- name: Update idol list | |
run: deno run --allow-net --allow-write ./tools/create-idol-list.js | |
- name: Format data | |
run: deno fmt ./data/* | |
- name: Commit the changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
branch: ${{ env.NEW_BRANCH_NAME }} | |
commit_message: 'chore: アイドル名リストを更新' | |
- name: Create pull request | |
uses: repo-sync/pull-request@v2 | |
with: | |
source_branch: ${{ env.NEW_BRANCH_NAME }} | |
destination_branch: 'main' | |
pr_title: 'chore: アイドル名リストを更新' | |
github_token: ${{ secrets.GITHUB_TOKEN }} |