From 78cdf2a106b80c95b0fcfaf923b9de6f5b695ea7 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Fri, 15 Nov 2024 19:06:18 +0800 Subject: [PATCH] chore: block deploy requests from non-develop branch --- .github/workflows/deploy-check.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/deploy-check.yml diff --git a/.github/workflows/deploy-check.yml b/.github/workflows/deploy-check.yml new file mode 100644 index 000000000..2d99974c5 --- /dev/null +++ b/.github/workflows/deploy-check.yml @@ -0,0 +1,19 @@ +name: Check Deploy + +on: + pull_request_target: + types: + - opened + - reopened + - synchronize + - edited + +jobs: + check: + runs-on: ubuntu-latest + steps: + - run: | + if [ ${{ github.head_ref }} != "develop" ] && [ ${{ github.base_ref }} == "main" ]; then + echo "Pull requests to main branch are only allowed from develop branch." + exit 1 + fi