name: Check Update

on:
  schedule:
    - cron: '43 20 * * *'
  workflow_dispatch:

jobs:
  check:
    name: Check Update
    runs-on: windows-latest
    env:
      TZ: 'Asia/Tokyo'
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 'lts/*'
          cache: yarn
      - run: yarn install --frozen-lockfile
      - run: yarn run check-update
      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v7
        with:
          commit-message: Update packages data
          branch: create-pull-request/check-update
          delete-branch: true
          title: '[Update] Update packages data'
          body: |
            Update some packages data
          labels: enhancement
          assignees: hal-shu-sato
          reviewers: hal-shu-sato
