Skip to content

Commit 8f7cdab

Browse files
authored
environment to allow for main if pr number doesn't exist (#337)
1 parent 4489592 commit 8f7cdab

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/stage-4-acceptance.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ jobs:
5353
registry-url: "https://npm.pkg.github.com"
5454
scope: "@nhsdigital"
5555

56+
- name: "Set environment"
57+
shell: bash
58+
run: |
59+
if [ "${{ inputs.pr_number }}" != "" ]; then
60+
echo "ENVIRONMENT=pr${{ inputs.pr_number }}" >> $GITHUB_ENV
61+
else
62+
echo "ENVIRONMENT=main" >> $GITHUB_ENV
63+
fi
64+
5665
- name: Trigger Acceptance Tests
5766
shell: bash
5867
env:
@@ -65,6 +74,6 @@ jobs:
6574
--infraRepoName "nhs-notify-supplier-api" \
6675
--releaseVersion "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" \
6776
--overrideProjectName "nhs" \
68-
--targetEnvironment "pr${{ inputs.pr_number }}" \
77+
--targetEnvironment "$ENVIRONMENT" \
6978
--targetAccountGroup "nhs-notify-supplier-api-dev" \
7079
--targetComponent "api"

0 commit comments

Comments
 (0)