Skip to content

Commit a71cc5a

Browse files
[PRMP-739] Restore branch to match 6ec104b
1 parent 93d4268 commit a71cc5a

File tree

111 files changed

+505
-3164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+505
-3164
lines changed

.github/actions/tf-plan-apply/action.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ inputs:
66
description: "AWS IAM Role to assume"
77
required: true
88

9-
bucket_prefix:
10-
description: "One of dev, test, pre-prod, prod"
11-
required: true
12-
13-
aws_account_id:
14-
description: "AWS Account ID"
15-
required: true
16-
179
aws_region:
1810
description: "AWS Region to use"
1911
required: true
@@ -22,7 +14,11 @@ inputs:
2214
terraform_version:
2315
description: "Terraform version to use"
2416
required: false
25-
default: "1.14.3"
17+
default: "1.13.3"
18+
19+
backend_conf:
20+
description: "Terraform backend config file"
21+
required: true
2622

2723
working_directory:
2824
description: "Terraform working directory"
@@ -42,11 +38,6 @@ inputs:
4238
required: false
4339
default: ""
4440

45-
tf_lock_timeout:
46-
description: "Time to wait for Terraform state lock (e.g., 20m)"
47-
required: false
48-
default: "20m"
49-
5041
do_apply:
5142
description: "Whether to run 'terraform apply' after 'terraform plan'"
5243
required: false
@@ -70,7 +61,7 @@ runs:
7061
terraform_wrapper: false
7162

7263
- name: Initialise Terraform
73-
run: terraform init -backend-config=bucket=ndr-${{ inputs.bucket_prefix }}-terraform-state-${{ inputs.aws_account_id }}
64+
run: terraform init -backend-config=${{ inputs.backend_conf }}
7465
working-directory: ${{ inputs.working_directory }}
7566
shell: bash
7667

@@ -86,12 +77,12 @@ runs:
8677

8778
- name: Run Terraform Plan
8879
run: |
89-
terraform plan -lock-timeout="${{ inputs.tf_lock_timeout }}" -input=false -no-color -var-file="${{ inputs.tf_vars_file }}" ${{ inputs.tf_extra_args }} -out tf.plan
80+
terraform plan -input=false -no-color -var-file="${{ inputs.tf_vars_file }}" ${{ inputs.tf_extra_args }} -out tf.plan
9081
working-directory: ${{ inputs.working_directory }}
9182
shell: bash
9283

9384
- name: Run Terraform Apply
9485
if: ${{ inputs.do_apply == 'true' }}
95-
run: terraform apply -lock-timeout="${{ inputs.tf_lock_timeout }}" -auto-approve -input=false tf.plan
86+
run: terraform apply -auto-approve -input=false tf.plan
9687
working-directory: ${{ inputs.working_directory }}
9788
shell: bash

.github/workflows/automated-deploy-dev.yml

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,41 +13,15 @@ permissions:
1313
actions: read # This is required for Plan comment
1414
id-token: write # This is required for requesting the JWT
1515
contents: write # This is required for SBOM action
16-
16+
1717
jobs:
18-
19-
# Terraform apply of base_iam will only occur on a push (merge request completion)
20-
terraform_plan_apply_base_iam:
21-
if: github.ref == 'refs/heads/main'
22-
name: Terraform Plan/Apply (base_iam)
23-
runs-on: ubuntu-latest
24-
environment: development
25-
steps:
26-
- name: Checkout branch
27-
uses: actions/checkout@v6
28-
29-
- name: Apply base_iam
30-
uses: ./.github/actions/tf-plan-apply
31-
with:
32-
aws_assume_role: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/dev-github-bootstrap
33-
bucket_prefix: "dev"
34-
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
35-
aws_region: ${{ vars.AWS_REGION }}
36-
working_directory: "./base_iam" # Use separate base_iam directory
37-
workspace: ${{ secrets.AWS_WORKSPACE }}
38-
tf_vars_file: ${{ vars.TF_VARS_FILE }}
39-
tf_extra_args: "-var aws_account_id=${{ secrets.AWS_ACCOUNT_ID }}"
40-
4118
terraform_plan_apply:
4219
name: Terraform Plan/Apply (ndr-dev)
4320
runs-on: ubuntu-latest
44-
needs: terraform_plan_apply_base_iam
45-
# Will run when terraform_plan_apply_base_iam completes or is skipped
46-
if: always() && (needs.terraform_plan_apply_base_iam.result == 'skipped' || needs.terraform_plan_apply_base_iam.result == 'success')
4721
environment: development
4822
steps:
4923
- name: Checkout
50-
uses: actions/checkout@v6
24+
uses: actions/checkout@v5
5125

5226
- name: Configure AWS Credentials
5327
uses: aws-actions/configure-aws-credentials@v5
@@ -60,7 +34,7 @@ jobs:
6034
- name: Setup Terraform
6135
uses: hashicorp/setup-terraform@v3
6236
with:
63-
terraform_version: 1.14.3
37+
terraform_version: 1.13.3
6438
terraform_wrapper: true
6539

6640
- name: Initialise Terraform
@@ -99,7 +73,7 @@ jobs:
9973
echo "::add-mask::$cert_block"
10074
fi
10175
done || echo "No certificate blocks found to mask."
102-
76+
10377
# Mask sensitive URLs in the Terraform Plan output
10478
grep -Eo 'https://[a-zA-Z0-9.-]+\.execute-api\.[a-zA-Z0-9.-]+\.amazonaws\.com/[a-zA-Z0-9/._-]*' tfplan.txt | while read -r api_url; do
10579
if [ -n "$api_url" ]; then
@@ -123,7 +97,6 @@ jobs:
12397
12498
# Mask GitHub secrets
12599
echo "::add-mask::${{ secrets.AWS_ASSUME_ROLE }}"
126-
echo "::add-mask::arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_WORKSPACE }}-github-actions-role"
127100
echo "::add-mask::${{ secrets.GITHUB_TOKEN }}"
128101
129102
# Mask Terraform variables
@@ -180,7 +153,7 @@ jobs:
180153
181154
// 2. Prepare format of the comment
182155
const output = `### Report for environment: ndr-dev
183-
156+
184157
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
185158
<details><summary>Initialization Output</summary>
186159
@@ -218,7 +191,7 @@ jobs:
218191
body: output
219192
})
220193
}
221-
194+
222195
github.rest.issues.createComment({
223196
issue_number: context.issue.number,
224197
owner: context.repo.owner,

.github/workflows/automated-pr-validator.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
pull-requests: write
1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@v6
20+
uses: actions/checkout@v5
2121
with:
2222
fetch-depth: 0
2323

@@ -130,7 +130,7 @@ jobs:
130130
contents: read
131131
steps:
132132
- name: Checkout repository
133-
uses: actions/checkout@v6
133+
uses: actions/checkout@v5
134134

135135
- name: Set up Python 3.11
136136
uses: actions/setup-python@v6

.github/workflows/automated-sonarqube-cloud-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@v6
20+
uses: actions/checkout@v5
2121
with:
2222
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
2323

2424
- name: SonarQube Cloud Scan
25-
uses: SonarSource/sonarqube-scan-action@v7
25+
uses: SonarSource/sonarqube-scan-action@v6
2626
env:
2727
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
2828
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/base-cleanup-lambda-edge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
environment: ${{ inputs.environment }}
3232
steps:
3333
- name: Checkout
34-
uses: actions/checkout@v6
34+
uses: actions/checkout@v5
3535
with:
3636
repository: 'NHSDigital/national-document-repository-infrastructure'
3737
ref: ${{ inputs.git_ref }}

.github/workflows/base-cleanup-workspace.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
environment: ${{ inputs.environment }}
3232
steps:
3333
- name: Checkout
34-
uses: actions/checkout@v6
34+
uses: actions/checkout@v5
3535
with:
3636
repository: 'NHSDigital/national-document-repository-infrastructure'
3737
ref: ${{ inputs.git_ref }}

.github/workflows/cron-daily-health-check.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
needs: ['set_workspace']
2929
steps:
3030
- name: Checkout
31-
uses: actions/checkout@v6
31+
uses: actions/checkout@v5
3232
with:
3333
ref: main
3434

@@ -43,7 +43,7 @@ jobs:
4343
- name: Setup Terraform
4444
uses: hashicorp/setup-terraform@v3
4545
with:
46-
terraform_version: 1.14.3
46+
terraform_version: 1.13.3
4747
terraform_wrapper: false
4848

4949
- name: Initialise Terraform
@@ -91,7 +91,7 @@ jobs:
9191
runs-on: ubuntu-latest
9292
steps:
9393
- name: Checkout
94-
uses: actions/checkout@v6
94+
uses: actions/checkout@v5
9595
with:
9696
repository: NHSDigital/national-document-repository
9797

@@ -113,7 +113,7 @@ jobs:
113113
working-directory: ./app
114114

115115
- name: Cypress Build
116-
uses: cypress-io/github-action@v7
116+
uses: cypress-io/github-action@v6
117117
with:
118118
install: false
119119
runTests: false
@@ -128,7 +128,7 @@ jobs:
128128
run: npm install serve -g
129129

130130
- name: Run Cypress Tests (Chrome)
131-
uses: cypress-io/github-action@v7
131+
uses: cypress-io/github-action@v6
132132
with:
133133
install: false
134134
start: serve -s dist
@@ -139,15 +139,15 @@ jobs:
139139
CYPRESS_grepTags: 'regression'
140140

141141
- name: Upload Artifacts (Screenshots)
142-
uses: actions/upload-artifact@v6
142+
uses: actions/upload-artifact@v4
143143
if: failure()
144144
with:
145145
name: cypress-screenshots-chrome
146146
path: /home/runner/work/national-document-repository/national-document-repository/app/cypress/screenshots
147147
if-no-files-found: ignore
148148

149149
- name: Upload Artifacts (Videos)
150-
uses: actions/upload-artifact@v6
150+
uses: actions/upload-artifact@v4
151151
if: failure()
152152
with:
153153
name: cypress-videos-chrome

.github/workflows/cron-tear-down-sandbox.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'Z-CRON: Tear down - Sandboxes'
22

33
on:
44
schedule:
5-
- cron: 59 18,20,22 * * 1-5 # utc time
5+
- cron: 59 18-21 * * 1-5 # utc time
66

77
permissions:
88
pull-requests: write
@@ -16,7 +16,7 @@ jobs:
1616
environment: development
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v6
19+
uses: actions/checkout@v5
2020
with:
2121
ref: main
2222

.github/workflows/cron-tear-down-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
sandbox-name: [ndr-test]
4242
steps:
4343
- name: Checkout
44-
uses: actions/checkout@v6
44+
uses: actions/checkout@v5
4545
with:
4646
ref: main
4747

@@ -56,7 +56,7 @@ jobs:
5656
- name: Setup Terraform
5757
uses: hashicorp/setup-terraform@v3
5858
with:
59-
terraform_version: 1.14.3
59+
terraform_version: 1.13.3
6060
terraform_wrapper: false
6161

6262
- name: Initialise Terraform

0 commit comments

Comments
 (0)