name: Close Pull Request
on:
  pull_request_target:
    types: [opened, reopened]

jobs:
  close-pr:
    runs-on: ubuntu-latest
    steps:
      - name: Close PR
        env:
          GH_TOKEN: ${{ github.token }}
          GH_REPO: ${{ github.repository }}
          PR: ${{ github.event.pull_request.number }}
        run: |
          gh pr close ${{ env.PR }} --comment "(Automated Close) Please do not file pull requests here, see https://firefox-source-docs.mozilla.org/contributing/how_to_submit_a_patch.html"
          gh pr lock ${{ env.PR }}
