From 5d4490458d9ffee11d6d50c25459b88e91d7a855 Mon Sep 17 00:00:00 2001 From: pozil Date: Wed, 26 Jul 2023 11:01:48 +0200 Subject: [PATCH] ci: fix condition --- .github/workflows/ci-pr.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 0df25beb..36305d5f 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -4,13 +4,18 @@ name: CI on PR # Definition when the workflow should run on: workflow_dispatch: + inputs: + prerelease: + description: 'Run on a prerelease org?' + required: false + type: boolean pull_request: types: [opened, edited, synchronize, reopened] # Workflow environment variables env: # Is the PR base branch a prerelease branch - IS_PRERELEASE_BRANCH: ${{ startsWith(github.event.pull_request.base.ref, 'prerelease/') }} + IS_PRERELEASE: ${{ startsWith(github.event.pull_request.base.ref, 'prerelease/') || inputs.prerelease }} # Jobs to be executed jobs: @@ -158,12 +163,12 @@ jobs: # Create prerelease scratch org - name: 'Create prerelease scratch org' - if: env.IS_PRERELEASE_BRANCH + if: env.IS_PRERELEASE run: sf org create scratch -f config/project-scratch-def.json -a scratch-org -d -y 1 --release=preview # Create scratch org - name: 'Create scratch org' - if: !env.IS_PRERELEASE_BRANCH + if: !env.IS_PRERELEASE run: sf org create scratch -f config/project-scratch-def.json -a scratch-org -d -y 1 # Deploy source to scratch org @@ -221,4 +226,4 @@ jobs: with: token: ${{ secrets.BOT_ACCESS_TOKEN }} event-type: start-packaging-pr - client-payload: '{ "ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "isPrelease": "${{ env.IS_PRERELEASE_BRANCH }}" }' + client-payload: '{ "ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "isPrelease": "${{ env.IS_PRERELEASE }}" }'