Skip to content

Commit

Permalink
ci: fix condition
Browse files Browse the repository at this point in the history
  • Loading branch information
pozil committed Jul 26, 2023
1 parent 23417b0 commit 5d44904
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 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_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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }}" }'

0 comments on commit 5d44904

Please sign in to comment.