-
Notifications
You must be signed in to change notification settings - Fork 17
/
check-subtree-split.yml
41 lines (32 loc) · 1.18 KB
/
check-subtree-split.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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 === "symfony") {
const monoRepo = /^polyfill-/.test(context.repo.repo) ? "polyfill" : (/^(ux-|stimulus-bundle)/.test(context.repo.repo) ? "ux" : "symfony");
github.rest.issues.createComment({
owner: "symfony",
repo: context.repo.repo,
issue_number: context.issue.number,
body: `
Thanks for your pull request! We love contributions.
However, you should instead open a pull request on the main repository:
https://github.com/symfony/${monoRepo}
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: "symfony",
repo: context.repo.repo,
pull_number: context.issue.number,
state: "closed"
});
}