8000 Auto-close PRs on subtree-splits · symfony/ux-cropperjs@bae40f1 · GitHub
[go: up one dir, main page]

Skip to content

Commit bae40f1

Browse files
committed
Auto-close PRs on subtree-splits
1 parent cab6a2c commit bae40f1

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

.gitattributes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
/.gitattributes export-ignore
2-
/.gitignore export-ignore
31
/.symfony.bundle.yaml export-ignore
42
/assets/src export-ignore
53
/assets/test export-ignore
64
/phpunit.xml.dist export-ignore
75
/tests export-ignore
6+
/.git* export-ignore

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Please do not submit any Pull Requests here. They will be closed.
2+
---
3+
Please submit your PR here instead:
4+
https://github.com/symfony/ux
5+
This repository is what we call a "subtree split": a read-only subset of that main repository.
6+
We're looking forward to your PR there!
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
However, you should instead open your PR on the main repository:
20+
https://github.com/symfony/ux
21+
This repository is what we call a "subtree split": a read-only subset of that main repository.
22+
We're looking forward to your PR there!
23+
`
24+
});
25+
github.rest.pulls.update({
26+
owner: "symfony",
27+
repo: context.repo.repo,
28+
pull_number: context.issue.number,
29+
state: "closed"
30+
});
31+
}

0 commit comments

Comments
 (0)
0