Skip to content

Commit a38844a

Browse files
authored
Merge pull request #135 from salesforcecli/ew/add-test-env
W-17239852 Add --test-environment to change case
2 parents 7297463 + 82da904 commit a38844a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.github/workflows/ctcOpen.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
on:
22
workflow_call:
3+
inputs:
4+
githubTag:
5+
description: 'The semver tag of the GitHub Release'
6+
type: string
37
outputs:
48
changeCaseId:
59
description: Id for the change case created
@@ -26,7 +30,12 @@ jobs:
2630
run: |
2731
# Temp disable exit on error
2832
set +e
29-
CTC_RESULT=$(sfchangecase create --location ${{github.repositoryUrl}} --release ${{github.repository}}.$(date +%F) --json)
33+
if [ -n "$GITHUB_TAG" ]; then
34+
RELEASE_URL="${{ github.server_url }}/${{ github.repository }}/releases/tag/$GITHUB_TAG"
35+
else
36+
RELEASE_URL="${{ github.server_url }}/${{ github.repository }}/releases"
37+
fi
38+
CTC_RESULT=$(sfchangecase create --location ${{github.repositoryUrl}} --test-environment $RELEASE_URL --release ${{github.repository}}.$(date +%F) --json)
3039
# Re-enable exit on error
3140
set -e
3241
@@ -42,6 +51,7 @@ jobs:
4251
exit 1
4352
fi
4453
env:
54+
GITHUB_TAG: ${{ inputs.githubTag }}
4555
SF_CHANGE_CASE_SFDX_AUTH_URL: ${{ secrets.SF_CHANGE_CASE_SFDX_AUTH_URL}}
4656
SF_CHANGE_CASE_TEMPLATE_ID: ${{ secrets.SF_CHANGE_CASE_TEMPLATE_ID}}
4757
SF_CHANGE_CASE_CONFIGURATION_ITEM: ${{ secrets.SF_CHANGE_CASE_CONFIGURATION_ITEM}}

.github/workflows/npmPublish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ jobs:
9595
needs: [check-publish]
9696
if: inputs.ctc && needs.check-publish.outputs.published == 'false'
9797
uses: salesforcecli/github-workflows/.github/workflows/ctcOpen.yml@main
98+
with:
99+
githubTag: ${{ inputs.githubTag }}
98100
secrets: inherit
99101

100102
npm-publish:

0 commit comments

Comments
 (0)