Skip to content

Commit 92b9255

Browse files
mdelapenyastevenh
andauthored
chore(ci): close PR if it was sent from main (#3123)
* chore(ci): close PR if it was sent from main * fix: typo * fix: typo Co-authored-by: Steven Hartland <[email protected]> --------- Co-authored-by: Steven Hartland <[email protected]>
1 parent 8a498b7 commit 92b9255

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/conventions.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,11 @@ jobs:
4747
docs
4848
chore
4949
deps
50+
51+
- name: Detect if the Pull Request was sent from the main branch
52+
if: "${{ github.head_ref == 'main' }}"
53+
env:
54+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
run: |
56+
gh pr close --comment "This Pull Request has been automatically closed because it was sent from the fork's main branch. Please use a different branch so that the maintainers can contribute to your Pull Request."
57+
exit 1

0 commit comments

Comments
 (0)