From b227b0957f9e4da4256d20ba245d1da43f6b2e95 Mon Sep 17 00:00:00 2001 From: Yaron Kaikov Date: Thu, 19 Sep 2024 10:43:36 +0300 Subject: [PATCH] [github/workflows/add-label-when-promoted] add support for running in enterprise repo Adding an enterprise branch as a valid option to be triggered. This will be used for supporting backports for enterprise features --- .github/workflows/add-label-when-promoted.yaml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/add-label-when-promoted.yaml b/.github/workflows/add-label-when-promoted.yaml index 06cf1809..8be0aad5 100644 --- a/.github/workflows/add-label-when-promoted.yaml +++ b/.github/workflows/add-label-when-promoted.yaml @@ -5,12 +5,10 @@ on: branches: - master - next-*.* + - enterprise pull_request_target: types: [labeled] - branches: [master, next] - -env: - DEFAULT_BRANCH: ${{ github.repository == 'scylladb/scylla-enterprise' && 'enterprise' || 'master' }} + branches: [master, next, enterprise] jobs: check-commit: @@ -23,6 +21,14 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" + - name: Set Default Branch + id: set_branch + run: | + if [[ "${{ github.repository }}" == *enterprise* ]]; then + echo "DEFAULT_BRANCH=enterprise" >> $GITHUB_ENV + else + echo "DEFAULT_BRANCH=master" >> $GITHUB_ENV + fi - name: Checkout repository uses: actions/checkout@v4 with: