name: close pull request
on:
  pull_request_target:
    types: [opened, reopened]
jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v4
        with:
          sparse-checkout: "readme.md"
          sparse-checkout-cone-mode: false
      - name: close
        env:
          GH_TOKEN: ${{ github.token }}
          PR: ${{ github.event.number }}
        run: |
          gh pr close ${{ env.PR }} --comment "(Automated Close) Please do not file pull requests here, see https://firefox-source-docs.mozilla.org/security/nss/community.html#how-to-contribute"
          gh pr lock ${{ env.PR }}
