name: Run Pinact

on:
  pull_request:
    types: [opened, synchronize, reopened]
    paths:
      - '.github/workflows/**'
      - '.github/actions/**'

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}-pinact
  cancel-in-progress: true

permissions:
  contents: write
  pull-requests: write

jobs:
  pinact:
    name: pinact
    runs-on: ubuntu-latest
    timeout-minutes: 3

    steps:
      - name: Checkout
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          persist-credentials: false

      - name: Pin actions
        uses: suzuki-shunsuke/pinact-action@d735505f3decf76fca3fdbb4c952e5b3eba0ffdd # v0.1.2
        with:
          app_id: ${{ vars.BOT_APP_ID }}
          app_private_key: ${{ secrets.BOT_APP_PRIVATE_KEY }}
