Skip to content

Commit

Permalink
ci: conditional pre-release build
Browse files Browse the repository at this point in the history
  • Loading branch information
pozil committed Aug 2, 2023
1 parent 89a2948 commit c547dba
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c547dba

Please sign in to comment.