Skip to content

Commit 734aa84

Browse files
Merge branch '6.4' into 7.0
* 6.4: Auto-close PRs on subtree-splits review German translation
2 parents 8447814 + 057ca68 commit 734aa84

File tree

494 files changed

+7631
-324
lines changed

Some content is hidden

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

494 files changed

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

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,4 +227,4 @@ jobs:
227227
run: |
228228
php src/Symfony/Component/Translation/Resources/bin/translation-status.php -v
229229
php .github/sync-translations.php
230-
git diff --exit-code src/ || (echo 'Run "php .github/sync-translations.php" to fix XLIFF files.' && exit 1)
230+
git diff --exit-code src/ || (echo '::error::Run "php .github/sync-translations.php" to fix XLIFF files.' && exit 1)

.github/workflows/package-tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ jobs:
101101
done
102102
103103
exit $ok
104+
104105
- name: Verify symfony/deprecation-contracts requirements
105106
run: |
106107
set +e
@@ -141,3 +142,9 @@ jobs:
141142
done
142143
143144
exit $ok
145+
146+
- name: Verify subtree-splits are auto-closed
147+
run: |
148+
php .github/sync-packages.php
149+
git add src/
150+
git diff --staged --exit-code || (echo '::error::Please run "php .github/sync-packages.php".' && exit 1)
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+
}

0 commit comments

Comments
 (0)