update #550
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-color-$(date '+%s')" >> $GITHUB_ENV | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 7 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'pnpm' | |
- name: Create new branch | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git switch -c ${{ env.NEW_BRANCH_NAME }} | |
- name: Install dependencies | |
run: pnpm install --no-frozen-lockfile | |
- name: Recreate color data | |
run: pnpm create:colors | |
- name: Format data | |
run: pnpm fmt:colors | |
- name: Commit the changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
branch: ${{ env.NEW_BRANCH_NAME }} | |
commit_message: 'chore: 色データを更新' | |
file_pattern: '/data/*.ts' | |
- 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 }} |