Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/actions/block-pr-not-on-main/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'block-pr-not-on-main'
description: 'Blocks PRs from main branch of forked repository'
runs:
using: "composite"
steps:
- name: Ensure PR is not on main branch
shell: bash
run: |
echo "Repo: ${{ github.repository }}"
echo "Head Repo: ${{ github.event.pull_request.head.repo.full_name }}"
echo "Forked: ${{ github.event.repository.fork }}"
echo "Branch: ${{ github.event.pull_request.head.ref }}"

if [ "${{ github.event.repository.fork }}" == "true" ] && [ "${{ github.event.pull_request.head.ref }}" == 'main' ]; then
echo "PRs from the main branch of forked repositories are not allowed."
exit 1
fi
3 changes: 3 additions & 0 deletions .github/workflows/ci-lint-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ jobs:

- name: Lint
run: make lint

- name: Ensure PR is not on main branch
uses: ./.github/actions/block-pr-not-on-main