mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-19 22:07:40 +00:00
Auto-close PRs on subtree-splits
This commit is contained in:
committed by
Nicolas Grekas
parent
ad934312cd
commit
b212f1bb2f
@@ -0,0 +1,33 @@
|
||||
name: Check subtree split
|
||||
on:
|
||||
pull_request_target:
|
||||
jobs:
|
||||
close-pull-request:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Close pull request
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
if (context.repo.owner === "twigphp") {
|
||||
github.rest.issues.createComment({
|
||||
owner: "twigphp",
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number,
|
||||
body: `
|
||||
Thanks for your Pull Request! We love contributions.
|
||||
|
||||
However, you should instead open your PR on the main repository:
|
||||
https://github.com/twigphp/Twig
|
||||
|
||||
This repository is what we call a "subtree split": a read-only subset of that main repository.
|
||||
We're looking forward to your PR there!
|
||||
`
|
||||
});
|
||||
github.rest.pulls.update({
|
||||
owner: "twigphp",
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.issue.number,
|
||||
state: "closed"
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user