From 4d610eb71708857f797e2c57eb0e48119f40a760 Mon Sep 17 00:00:00 2001 From: Chaminda Divitotawela Date: Wed, 25 Sep 2024 17:24:15 +1000 Subject: [PATCH] Default branch validate --- .github/workflows/draft-release.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 6a0ca3b72fc..f5603528ce1 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -18,6 +18,16 @@ jobs: env: RELEASE_NAME: "${{ inputs.tag }}" steps: + - name: Check default branch + run: | + echo "github.ref_name=${{ github.ref_name }}" + echo "github.event.repository.default_branch=${{ github.event.repository.default_branch }}" + if [[ ${{ github.ref_name }} != ${{ github.event.repository.default_branch }} ]] + then + echo "This workflow can only be run on default branch" + exit 1 + fi + - name: Pre-process Release Name id: pre_process_release_name run: |