Skip to content

Commit bedbdae

Browse files
committed
CCM-11908: Test
1 parent 63a923e commit bedbdae

File tree

2 files changed

+18
-36
lines changed

2 files changed

+18
-36
lines changed

.github/workflows/pr_create_dynamic_env.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ concurrency:
1212
jobs:
1313
create-dynamic-environment:
1414
name: Create Dynamic Environment
15-
needs: generate-sandbox-name
15+
permissions:
16+
id-token: write
17+
contents: read
1618
uses: ./.github/workflows/dispatch_internal_repo_workflow.yaml
1719
secrets: inherit
1820
with:

.github/workflows/pr_destroy_dynamic_env.yaml

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,19 @@ concurrency:
99
cancel-in-progress: false
1010

1111
jobs:
12-
create-dynamic-environment:
12+
destroy-dynamic-environment:
1313
name: Destroy Dynamic Environment
14-
runs-on: ubuntu-latest
15-
16-
steps:
17-
- name: Trigger nhs-notify-internal dynamic environment destruction
18-
shell: bash
19-
run: |
20-
set -x
21-
this_repo_name=$(echo ${{ github.repository }} | cut -d'/' -f2)
22-
23-
DISPATCH_EVENT=$(jq -ncM \
24-
--arg infraRepoName "${this_repo_name}" \
25-
--arg releaseVersion "main" \
26-
--arg targetEnvironment "pr${{ github.event.number }}" \
27-
--arg targetAccountGroup "nhs-notify-template-management-dev" \
28-
--arg targetComponent "branch" \
29-
--arg terraformAction "destroy" \
30-
'{ "ref": "main",
31-
"inputs": {
32-
"infraRepoName": $infraRepoName,
33-
"releaseVersion", $releaseVersion,
34-
"targetEnvironment", $targetEnvironment,
35-
"targetAccountGroup", $targetAccountGroup,
36-
"targetComponent", $targetComponent,
37-
"terraformAction", $terraformAction,
38-
}
39-
}')
40-
41-
curl --fail -L \
42-
-X POST \
43-
-H "Accept: application/vnd.github+json" \
44-
-H "Authorization: Bearer ${{ secrets.PR_TRIGGER_PAT }}" \
45-
-H "X-GitHub-Api-Version: 2022-11-28" \
46-
https://api.github.com/repos/NHSDigital/nhs-notify-internal/actions/workflows/dispatch-deploy-dynamic-env.yaml/dispatches \
47-
-d "${DISPATCH_EVENT}"
14+
permissions:
15+
id-token: write
16+
contents: read
17+
uses: ./.github/workflows/dispatch_internal_repo_workflow.yaml
18+
secrets: inherit
19+
with:
20+
jobName: Sandbox set up
21+
infraRepoName: nhs-notify-web-template-management
22+
releaseVersion: main
23+
targetWorkflow: dispatch-deploy-dynamic-env.yaml
24+
targetEnvironment: pr${{ github.event.number }}
25+
targetAccountGroup: nhs-notify-template-management-dev
26+
targetComponent: branch
27+
terraformAction: destroy

0 commit comments

Comments
 (0)