name: go-mod-tidy-pr

on:
  schedule:
    - cron: "0 22 * * 0" # JST 7:00 (Mon)

jobs:
  go-mod-tidy-pr:
    name: go-mod-tidy-pr

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Run go-mod-tidy-pr
        uses: sue445/go-mod-tidy-pr@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          git_user_name: GitHub Actions
          git_user_email: github-actions@example.cpm
          assign: sue445
          labels: go-mod-tidy
          timezone: Asia/Tokyo

name: go-mod-tidy-pr

on:
  schedule:
    - cron: "0 22 * * 0" # JST 7:00 (Mon)

jobs:
  go-mod-tidy-pr:
    name: go-mod-tidy-pr

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Generate token
        id: generate_token
        uses: tibdex/github-app-token@v1
        with:
          app_id: ${{ secrets.GH_APP_ID }}
          private_key: ${{ secrets.GH_PRIVATE_KEY }}

      - name: Run go-mod-tidy-pr
        uses: sue445/go-mod-tidy-pr@master
        with:
          github_token: ${{ steps.generate_token.outputs.token }}
          git_user_name: GitHub Actions
          git_user_email: github-actions@example.cpm
          assign: sue445
          labels: go-mod-tidy
          timezone: Asia/Tokyo

Use GitHub App Token instead of GITHUB_TOKEN
Use GitHub App Token instead of GITHUB_TOKEN

c.f. https://github.com/sue445/go-mod-tidy-pr#note-warning
