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 c1bedbe commit 1a8d68d
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,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: ${{ 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 @@ -131,12 +136,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 --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

# Deploy source to scratch org
Expand Down

0 comments on commit 1a8d68d

Please sign in to comment.