Skip to content

Commit 5767bd4

Browse files
Merge pull request #146 from salesforcecli/ew/no-ctc-for-prerelease
W-16572956: dont open ctc for prereleases
2 parents 9ca1714 + 707f85c commit 5767bd4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/npmPublish.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ on:
3636
required: false
3737
ctc:
3838
description: |
39-
Use CTC. Requires environment to contain
40-
SF_CHANGE_CASE_SFDX_AUTH_URL, SF_CHANGE_CASE_TEMPLATE_ID, SF_CHANGE_CASE_CONFIGURATION_ITEM.
41-
Also requires a static ip runner (you can't use ubuntu-latest)
39+
Use CTC.
40+
- Only opens when publishing to 'latest'. Will NOT open for prerelease tags (e.g. dev, beta, qa)
41+
- Requires env vars: SF_CHANGE_CASE_SFDX_AUTH_URL, SF_CHANGE_CASE_TEMPLATE_ID, SF_CHANGE_CASE_CONFIGURATION_ITEM.
42+
- Requires a static IP runner (you cannot use ubuntu-latest)
4243
type: boolean
4344
required: false
4445
runsOn:
@@ -108,15 +109,16 @@ jobs:
108109

109110
ctc-open:
110111
needs: [check-publish]
111-
if: inputs.ctc && needs.check-publish.outputs.published == 'false'
112+
# CTC will only open when publishing to 'latest'
113+
if: inputs.ctc && needs.check-publish.outputs.published == 'false' && inputs.tag == 'latest'
112114
uses: salesforcecli/github-workflows/.github/workflows/ctcOpen.yml@main
113115
with:
114116
githubTag: ${{ inputs.githubTag }}
115117
secrets: inherit
116118

117119
npm-publish:
118120
needs: [check-publish, ctc-open]
119-
if: ${{ always() && needs.check-publish.outputs.published == 'false' && (!inputs.ctc || (inputs.ctc && needs.ctc-open.outputs.changeCaseId)) }}
121+
if: ${{ always() && needs.check-publish.outputs.published == 'false' && (!inputs.ctc || (inputs.ctc && inputs.tag != 'latest') || (inputs.ctc && needs.ctc-open.outputs.changeCaseId)) }}
120122
runs-on: ${{ inputs.runsOn }}
121123
env:
122124
INPUTS_PACKAGE_MANAGER: ${{ inputs.packageManager }}

0 commit comments

Comments
 (0)