name: PR Policy
on:
pull_request_target: types: [opened]
permissions: {}
jobs:
close-external-pr:
name: Close External Fork PR
if: ${{ github.event.pull_request.head.repo.fork == true }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Politely close external pull request
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
GH_REPO: ${{ github.repository }}
run: |
gh pr close "$PR_NUMBER" --comment "感谢关注本仓库。本仓库目前仅接受内部维护者的 Pull Request,暂不接受外部 PR。如有 Bug 反馈或功能建议,欢迎通过 Issue 提交。"