Auto-close PRs on subtree-splits

Auto-close PRs on subtree-splits

АвторNicolas Grekas
КоммитерNicolas Grekas
год назад
Файлов изменено: 3
+46
–2
3356c93
Родители 3c8deb7 5.4
.gitattributes
@@ -1,4 +1,3 @@
/Tests export-ignore
/phpunit.xml.dist export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.git* export-ignore
.github/PULL_REQUEST_TEMPLATE.md
0 100644
@@ -0,0 +1,8 @@
Please do not submit any Pull Requests here. They will be closed.
---
Please submit your PR here instead:
https://github.com/symfony/symfony
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/workflows/check-subtree-split.yml
0 100644
@@ -0,0 +1,37 @@
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") {
            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 your PR on the main repository:
          https://github.com/symfony/symfony
          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"
            });
          }

Cherry-pick

Команда cherry-pick позволяет выбрать отдельные коммиты из одной ветки и применить их к другой.