name: 🔀 Auto merge PR

on:
  workflow_run:
    workflows: ["🔨 Build Test"]
    types: [completed]

permissions:
  contents: write
  pull-requests: write

jobs:
  auto-merge-dependabot:
    runs-on: ubuntu-latest
    if: ${{ github.event.workflow_run.conclusion == 'success' }}
    steps:
      - uses: projectdiscovery/actions/pr/approve@v1
      - uses: projectdiscovery/actions/pr/merge@v1
        with:
          auto: "true"
