From c547dba7ee27062f1ab785b7020d5562e1ccfaa7 Mon Sep 17 00:00:00 2001 From: Philippe Ozil Date: Wed, 2 Aug 2023 11:15:49 +0200 Subject: [PATCH] ci: conditional pre-release build --- .github/workflows/ci-pr.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 43d9e792..9df1b63d 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -4,6 +4,11 @@ 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] branches-ignore: @@ -12,7 +17,7 @@ on: # Workflow environment variables env: # Is the PR base branch a prerelease branch - IS_PRERELEASE: ${{ 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: @@ -168,12 +173,12 @@ jobs: # Create prerelease scratch org - name: 'Create prerelease scratch org' - if: env.IS_PRERELEASE + if: ${{ env.IS_PRERELEASE }} run: sf org create scratch -f config/project-scratch-def.json -a scratch-org -d -y 1 -c --release=preview # Create scratch org - name: 'Create scratch org' - if: !env.IS_PRERELEASE + if: ${{ !env.IS_PRERELEASE }} run: sf org create scratch -f config/project-scratch-def.json -a scratch-org -d -y 1 -c # Deploy source to scratch org