name: Thirdparty

on:
  schedule:
    - cron: '54 10 * * *'

permissions:
  contents: write
  pull-requests: write

jobs:
  update:
    runs-on: ubuntu-latest
    timeout-minutes: 10

    steps:
    - uses: actions/setup-node@v4
      with:
        node-version: 20
    - uses: actions/checkout@v4
    - name: Install packages
      run: |
        yarn install
        npm install -g license-checker
    - name: Check
      run: |
        yarn run thirdparty
    - uses: peter-evans/create-pull-request@v6
      with:
        commit-message: "[Auto update] Thirdparty libraries list"
        branch: auto-update/thirdparty
        base: main
        delete-branch: true
        title: "[Auto update] Thirdparty libraries list"
