Skip to content

Commit 06b6fc6

Browse files
kbondnicolas-grekas
authored andcommitted
Auto-close PRs on subtree-splits
1 parent 861391a commit 06b6fc6

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.git* export-ignore

.github/PULL_REQUEST_TEMPLATE.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Please do not submit any Pull Requests here. They will be closed.
2+
---
3+
4+
Please submit your PR here instead:
5+
https://github.com/symfony/polyfill
6+
7+
This repository is what we call a "subtree split": a read-only subset of that main repository.
8+
We're looking forward to your PR there!
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Check subtree split
2+
on:
3+
pull_request_target:
4+
jobs:
5+
close-pull-request:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Close pull request
9+
uses: actions/github-script@v6
10+
with:
11+
script: |
12+
if (context.repo.owner === "symfony") {
13+
github.rest.issues.createComment({
14+
owner: "symfony",
15+
repo: context.repo.repo,
16+
issue_number: context.issue.number,
17+
body: `
18+
Thanks for your Pull Request! We love contributions.
19+
20+
However, you should instead open your PR on the main repository:
21+
https://github.com/symfony/polyfill
22+
23+
This repository is what we call a "subtree split": a read-only subset of that main repository.
24+
We're looking forward to your PR there!
25+
`
26+
});
27+
github.rest.pulls.update({
28+
owner: "symfony",
29+
repo: context.repo.repo,
30+
pull_number: context.issue.number,
31+
state: "closed"
32+
});
33+
}

0 commit comments

Comments
 (0)