From 64c1aebda5d1ad5e1d119ba5e9f76d395aab6947 Mon Sep 17 00:00:00 2001 From: Tharun Kumar Merugu Date: Thu, 8 Aug 2024 11:19:58 +0000 Subject: [PATCH] Prevent pull request to main Signed-off-by: Tharun Kumar Merugu --- .github/workflows/pull_request_check.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/pull_request_check.yml diff --git a/.github/workflows/pull_request_check.yml b/.github/workflows/pull_request_check.yml new file mode 100644 index 0000000..43ce0c5 --- /dev/null +++ b/.github/workflows/pull_request_check.yml @@ -0,0 +1,20 @@ +name: Prevent pull request to main +on: + pull_request_target: + types: + - opened + - reopened + - synchronize + - edited + +jobs: + check-branches: + runs-on: ubuntu-latest + steps: + - name: Check branches + run: | + if [ ${{ github.head_ref }} != "development" ] && [ ${{ github.base_ref }} == "main" ]; then + echo "Create a pull request to quic/development branch" + echo "Pull requests to main branch are only allowed from quic/development branch." + exit 1 + fi \ No newline at end of file