- Add .github/workflows/close-prs.yml — politely auto-closes any opened/reopened pull request (pull_request_target, no PR-code checkout, so it's safe for fork PRs). - README: note up front that issues are disabled, PRs are auto-closed, no support/contributions, and that forking under GPL-3.0 is welcome. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
34 lines
1.2 KiB
YAML
34 lines
1.2 KiB
YAML
name: Auto-close pull requests
|
|
|
|
# This repository is published for reference only and does not accept contributions.
|
|
# Any pull request is closed automatically with a polite note. Runs via pull_request_target
|
|
# (base-repo token, write access) and does NOT check out the PR code, so it's safe for fork PRs.
|
|
|
|
on:
|
|
pull_request_target:
|
|
types: [opened, reopened]
|
|
|
|
permissions:
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
close:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
const n = context.payload.pull_request.number;
|
|
await github.rest.issues.createComment({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: n,
|
|
body: "Thanks for your interest! 🙏 This repository is published for reference only — it doesn't accept contributions and no support is provided, so this pull request is being closed automatically. You're very welcome to fork and adapt it under the GPL-3.0 license.",
|
|
});
|
|
await github.rest.pulls.update({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
pull_number: n,
|
|
state: "closed",
|
|
});
|