Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c3ff44e

Browse files
Auto-close PRs on subtree-splits
1 parent 18c3e87 commit c3ff44e

File tree

390 files changed

+6011
-244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

390 files changed

+6011
-244
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
/src/Symfony/Component/Runtime export-ignore
77
/src/Symfony/Component/Translation/Bridge export-ignore
88
/src/Symfony/Component/Intl/Resources/data/*/* linguist-generated=true
9+
/.git* export-ignore

.github/sync-packages.php

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?php
2+
3+
use Symfony\Component\Finder\Finder;
4+
5+
require __DIR__.'/../vendor/autoload.php';
6+
7+
$mainRepo = 'https://github.com/symfony/symfony';
8+
$finder = new Finder();
9+
$packages = $finder->files()->in(__DIR__.'/../src/')->name('composer.json');
10+
11+
foreach ($packages as $package) {
12+
$package = $package->getPath();
13+
$c = file_get_contents($package.'/.gitattributes');
14+
$c = preg_replace('{^/\.git.*+\n}m', '', $c);
15+
$c .= "/.git* export-ignore\n";
16+
file_put_contents($package.'/.gitattributes', $c);
17+
18+
19+
@mkdir($package.'/.github');
20+
file_put_contents($package.'/.github/PULL_REQUEST_TEMPLATE.md', <<<EOTXT
21+
Please do not submit any Pull Requests here. They will be closed.
22+
---
23+
24+
Please submit your PR here instead:
25+
{$mainRepo}
26+
27+
This repository is what we call a "subtree split": a read-only subset of that main repository.
28+
We're looking forward to your PR there!
29+
30+
EOTXT
31+
);
32+
33+
@mkdir($package.'/.github/workflows');
34+
file_put_contents($package.'/.github/workflows/check-subtree-split.yml', <<<EOTXT
35+
name: Check subtree split
36+
37+
on:
38+
pull_request_target:
39+
40+
jobs:
41+
close-pull-request:
42+
runs-on: ubuntu-latest
43+
44+
steps:
45+
- name: Close pull request
46+
uses: actions/github-script@v6
47+
with:
48+
script: |
49+
if (context.repo.owner === "symfony") {
50+
github.rest.issues.createComment({
51+
owner: "symfony",
52+
repo: context.repo.repo,
53+
issue_number: context.issue.number,
54+
body: `
55+
Thanks for your Pull Request! We love contributions.
56+
57+
However, you should instead open your PR on the main repository:
58+
{$mainRepo}
59+
60+
This repository is what we call a "subtree split": a read-only subset of that main repository.
61+
We're looking forward to your PR there!
62+
`
63+
});
64+
65+
github.rest.pulls.update({
66+
owner: "symfony",
67+
repo: context.repo.repo,
68+
pull_number: context.issue.number,
69+
state: "closed"
70+
});
71+
}
72+
73+
EOTXT
74+
);
75+
}

.gitsplit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://github.com/symfony/symfony
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
/Tests export-ignore
22
/phpunit.xml.dist export-ignore
3-
/.gitattributes export-ignore
4-
/.gitignore export-ignore
3+
/.git* export-ignore
Lines changed: 8 additions & 0 deletions
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/symfony
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!
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Check subtree split
2+
3+
on:
4+
pull_request_target:
5+
6+
jobs:
7+
close-pull-request:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Close pull request
12+
uses: actions/github-script@v6
13+
with:
14+
script: |
15+
if (context.repo.owner === "symfony") {
16+
github.rest.issues.createComment({
17+
owner: "symfony",
18+
repo: context.repo.repo,
19+
issue_number: context.issue.number,
20+
body: `
21+
Thanks for your Pull Request! We love contributions.
22+
23+
However, you should instead open your PR on the main repository:
24+
https://github.com/symfony/symfony
25+
26+
This repository is what we call a "subtree split": a read-only subset of that main repository.
27+
We're looking forward to your PR there!
28+
`
29+
});
30+
31+
github.rest.pulls.update({
32+
owner: "symfony",
33+
repo: context.repo.repo,
34+
pull_number: context.issue.number,
35+
state: "closed"
36+
});
37+
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
/Tests export-ignore
22
/phpunit.xml.dist export-ignore
3-
/.gitattributes export-ignore
4-
/.gitignore export-ignore
3+
/.git* export-ignore
Lines changed: 8 additions & 0 deletions
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/symfony
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!
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Check subtree split
2+
3+
on:
4+
pull_request_target:
5+
6+
jobs:
7+
close-pull-request:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Close pull request
12+
uses: actions/github-script@v6
13+
with:
14+
script: |
15+
if (context.repo.owner === "symfony") {
16+
github.rest.issues.createComment({
17+
owner: "symfony",
18+
repo: context.repo.repo,
19+
issue_number: context.issue.number,
20+
body: `
21+
Thanks for your Pull Request! We love contributions.
22+
23+
However, you should instead open your PR on the main repository:
24+
https://github.com/symfony/symfony
25+
26+
This repository is what we call a "subtree split": a read-only subset of that main repository.
27+
We're looking forward to your PR there!
28+
`
29+
});
30+
31+
github.rest.pulls.update({
32+
owner: "symfony",
33+
repo: context.repo.repo,
34+
pull_number: context.issue.number,
35+
state: "closed"
36+
});
37+
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
/Tests export-ignore
22
/phpunit.xml.dist export-ignore
3-
/.gitattributes export-ignore
4-
/.gitignore export-ignore
3+
/.git* export-ignore
Lines changed: 8 additions & 0 deletions
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/symfony
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!
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Check subtree split
2+
3+
on:
4+
pull_request_target:
5+
6+
jobs:
7+
close-pull-request:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Close pull request
12+
uses: actions/github-script@v6
13+
with:
14+
script: |
15+
if (context.repo.owner === "symfony") {
16+
github.rest.issues.createComment({
17+
owner: "symfony",
18+
repo: context.repo.repo,
19+
issue_number: context.issue.number,
20+
body: `
21+
Thanks for your Pull Request! We love contributions.
22+
23+
However, you should instead open your PR on the main repository:
24+
https://github.com/symfony/symfony
25+
26+
This repository is what we call a "subtree split": a read-only subset of that main repository.
27+
We're looking forward to your PR there!
28+
`
29+
});
30+
31+
github.rest.pulls.update({
32+
owner: "symfony",
33+
repo: context.repo.repo,
34+
pull_number: context.issue.number,
35+
state: "closed"
36+
});
37+
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
/Tests export-ignore
22
/phpunit.xml.dist export-ignore
3-
/.gitattributes export-ignore
4-
/.gitignore export-ignore
3+
/.git* export-ignore
Lines changed: 8 additions & 0 deletions
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/symfony
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!
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Check subtree split
2+
3+
on:
4+
pull_request_target:
5+
6+
jobs:
7+
close-pull-request:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Close pull request
12+
uses: actions/github-script@v6
13+
with:
14+
script: |
15+
if (context.repo.owner === "symfony") {
16+
github.rest.issues.createComment({
17+
owner: "symfony",
18+
repo: context.repo.repo,
19+
issue_number: context.issue.number,
20+
body: `
21+
Thanks for your Pull Request! We love contributions.
22+
23+
However, you should instead open your PR on the main repository:
24+
https://github.com/symfony/symfony
25+
26+
This repository is what we call a "subtree split": a read-only subset of that main repository.
27+
We're looking forward to your PR there!
28+
`
29+
});
30+
31+
github.rest.pulls.update({
32+
owner: "symfony",
33+
repo: context.repo.repo,
34+
pull_number: context.issue.number,
35+
state: "closed"
36+
});
37+
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
/Tests export-ignore
22
/phpunit.xml.dist export-ignore
3-
/.gitattributes export-ignore
4-
/.gitignore export-ignore
3+
/.git* export-ignore
Lines changed: 8 additions & 0 deletions
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/symfony
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!
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Check subtree split
2+
3+
on:
4+
pull_request_target:
5+
6+
jobs:
7+
close-pull-request:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Close pull request
12+
uses: actions/github-script@v6
13+
with:
14+
script: |
15+
if (context.repo.owner === "symfony") {
16+
github.rest.issues.createComment({
17+
owner: "symfony",
18+
repo: context.repo.repo,
19+
issue_number: context.issue.number,
20+
body: `
21+
Thanks for your Pull Request! We love contributions.
22+
23+
However, you should instead open your PR on the main repository:
24+
https://github.com/symfony/symfony
25+
26+
This repository is what we call a "subtree split": a read-only subset of that main repository.
27+
We're looking forward to your PR there!
28+
`
29+
});
30+
31+
github.rest.pulls.update({
32+
owner: "symfony",
33+
repo: context.repo.repo,
34+
pull_number: context.issue.number,
35+
state: "closed"
36+
});
37+
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
/Tests export-ignore
22
/phpunit.xml.dist export-ignore
3-
/.gitattributes export-ignore
4-
/.gitignore export-ignore
3+
/.git* export-ignore
Lines changed: 8 additions & 0 deletions
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/symfony
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!

0 commit comments

Comments
 (0)