@@ -9,39 +9,19 @@ concurrency:
99 cancel-in-progress : false
1010
1111jobs :
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