Skip to content

Commit 60fa864

Browse files
m-houstonCopilot
andauthored
Sync upstream repository template changes and apply dependabot version updates (#57)
* Merge dependabot PR changes Updated current branch with the safe equivalents of several stale/conflicted Dependabot PRs. Applied docs lockfile security updates for addressable, nokogiri, and rexml, and refreshed selected GitHub Actions dependencies (actions/checkout, actions/upload-artifact, actions/download-artifact, ossf/scorecard-action) by resolving conflicts against the current workflow files rather than merging outdated branches directly. Skipped stale or unsafe PRs, including the outdated activesupport bump and several obsolete npm branches targeting old repo paths or already-satisfied versions. Validated with pre-commit run --config scripts/config/pre-commit.yaml --files ..., file error checks, and git diff --check. Local docs build remains to be run on a Ruby/Bundler setup compatible with docs/Gemfile.lock. * Update GitHub Actions to use latest action versions and improve error handling in scripts * Update actions/checkout and actions/setup-node versions in workflow files Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 17f6396 commit 60fa864

21 files changed

Lines changed: 170 additions & 96 deletions

.github/actions/build-docs/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ runs:
88
using: "composite"
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v4
12-
- uses: actions/setup-node@v4
11+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
12+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
1313
with:
1414
node-version: 18
1515
- name: Npm cli install

.github/actions/bundle-ddb-publish/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ runs:
1919
using: "composite"
2020
steps:
2121
- name: Set up Node.js
22-
uses: actions/setup-node@v4
22+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
2323
with:
2424
node-version: "${{ inputs.node-version }}"
2525
cache: npm

.github/actions/create-lines-of-code-report/action.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ runs:
3232
run: zip lines-of-code-report.json.zip lines-of-code-report.json
3333
- name: "Upload CLOC report as an artefact"
3434
if: ${{ !env.ACT }}
35-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
35+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
3636
with:
3737
name: lines-of-code-report.json.zip
3838
path: ./lines-of-code-report.json.zip
@@ -44,7 +44,7 @@ runs:
4444
echo "secrets_exist=${{ inputs.idp_aws_report_upload_role_name != '' && inputs.idp_aws_report_upload_bucket_endpoint != '' }}" >> $GITHUB_OUTPUT
4545
- name: "Authenticate to send the report"
4646
if: steps.check.outputs.secrets_exist == 'true'
47-
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4
47+
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6
4848
with:
4949
role-to-assume: arn:aws:iam::${{ inputs.idp_aws_report_upload_account_id }}:role/${{ inputs.idp_aws_report_upload_role_name }}
5050
aws-region: ${{ inputs.idp_aws_report_upload_region }}

.github/actions/scan-dependencies/action.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ runs:
3232
run: zip sbom-repository-report.json.zip sbom-repository-report.json
3333
- name: "Upload SBOM report as an artefact"
3434
if: ${{ !env.ACT }}
35-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
35+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
3636
with:
3737
name: sbom-repository-report.json.zip
3838
path: ./sbom-repository-report.json.zip
@@ -47,7 +47,7 @@ runs:
4747
run: zip vulnerabilities-repository-report.json.zip vulnerabilities-repository-report.json
4848
- name: "Upload vulnerabilities report as an artefact"
4949
if: ${{ !env.ACT }}
50-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
50+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
5151
with:
5252
name: vulnerabilities-repository-report.json.zip
5353
path: ./vulnerabilities-repository-report.json.zip
@@ -58,7 +58,7 @@ runs:
5858
run: echo "secrets_exist=${{ inputs.idp_aws_report_upload_role_name != '' && inputs.idp_aws_report_upload_bucket_endpoint != '' }}" >> $GITHUB_OUTPUT
5959
- name: "Authenticate to send the reports"
6060
if: steps.check.outputs.secrets_exist == 'true'
61-
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4
61+
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6
6262
with:
6363
role-to-assume: arn:aws:iam::${{ inputs.idp_aws_report_upload_account_id }}:role/${{ inputs.idp_aws_report_upload_role_name }}
6464
aws-region: ${{ inputs.idp_aws_report_upload_region }}

.github/scripts/dispatch_internal_repo_workflow.sh

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,35 @@
3434

3535
set -e
3636

37+
usage() {
38+
cat >&2 <<'EOF'
39+
Usage:
40+
./dispatch_internal_repo_workflow.sh \
41+
--infraRepoName <repo> \
42+
--releaseVersion <version> \
43+
--targetWorkflow <workflow.yaml> \
44+
--targetEnvironment <env> \
45+
--targetComponent <component> \
46+
--targetAccountGroup <group> \
47+
[--terraformAction <action>] \
48+
[--internalRef <ref>] \
49+
[--overrides <overrides>] \
50+
[--overrideProjectName <name>] \
51+
[--overrideRoleName <name>]
52+
EOF
53+
}
54+
55+
require_arg() {
56+
local name="$1"
57+
local value="$2"
58+
59+
if [[ -z "$value" ]]; then
60+
echo "[ERROR] Missing required argument: $name" >&2
61+
usage
62+
exit 1
63+
fi
64+
}
65+
3766
while [[ $# -gt 0 ]]; do
3867
case $1 in
3968
--infraRepoName) # Name of the infrastructure repo in NHSDigital org (required)
@@ -87,6 +116,13 @@ while [[ $# -gt 0 ]]; do
87116
esac
88117
done
89118

119+
require_arg "--infraRepoName" "${infraRepoName:-}"
120+
require_arg "--releaseVersion" "${releaseVersion:-}"
121+
require_arg "--targetWorkflow" "${targetWorkflow:-}"
122+
require_arg "--targetEnvironment" "${targetEnvironment:-}"
123+
require_arg "--targetComponent" "${targetComponent:-}"
124+
require_arg "--targetAccountGroup" "${targetAccountGroup:-}"
125+
90126
if [[ -z "$APP_PEM_FILE" ]]; then
91127
echo "[ERROR] PEM_FILE environment variable is not set or is empty."
92128
exit 1
@@ -166,9 +202,9 @@ echo " internalRef: $internalRef"
166202
echo " overrides: $overrides"
167203
echo " overrideProjectName: $overrideProjectName"
168204
echo " overrideRoleName: $overrideRoleName"
169-
echo " targetProject: $targetProject"
170205

171206
DISPATCH_EVENT=$(jq -ncM \
207+
--arg internalRef "$internalRef" \
172208
--arg infraRepoName "$infraRepoName" \
173209
--arg releaseVersion "$releaseVersion" \
174210
--arg targetEnvironment "$targetEnvironment" \
@@ -179,21 +215,19 @@ DISPATCH_EVENT=$(jq -ncM \
179215
--arg overrides "$overrides" \
180216
--arg overrideProjectName "$overrideProjectName" \
181217
--arg overrideRoleName "$overrideRoleName" \
182-
--arg targetProject "$targetProject" \
183218
'{
184-
"ref": "'"$internalRef"'",
219+
"ref": $internalRef,
185220
"inputs": (
186221
(if $infraRepoName != "" then { "infraRepoName": $infraRepoName } else {} end) +
187222
(if $terraformAction != "" then { "terraformAction": $terraformAction } else {} end) +
188223
(if $overrideProjectName != "" then { "overrideProjectName": $overrideProjectName } else {} end) +
189224
(if $overrideRoleName != "" then { "overrideRoleName": $overrideRoleName } else {} end) +
190-
(if $targetProject != "" then { "targetProject": $targetProject } else {} end) +
191225
{
192226
"releaseVersion": $releaseVersion,
193227
"targetEnvironment": $targetEnvironment,
194228
"targetAccountGroup": $targetAccountGroup,
195229
"targetComponent": $targetComponent,
196-
"overrides": $overrides,
230+
"overrides": $overrides
197231
}
198232
)
199233
}')

.github/workflows/cicd-1-pull-request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
does_pull_request_exist: ${{ steps.pr_exists.outputs.does_pull_request_exist }}
3030
steps:
3131
- name: "Checkout code"
32-
uses: actions/checkout@v4
32+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3333
- name: "Set CI/CD variables"
3434
id: variables
3535
run: |

.github/workflows/cicd-3-deploy.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
# tag: ${{ steps.variables.outputs.tag }}
3838
steps:
3939
- name: "Checkout code"
40-
uses: actions/checkout@v4
40+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
4141
- name: "Set CI/CD variables"
4242
id: variables
4343
run: |
@@ -48,7 +48,7 @@ jobs:
4848
echo "nodejs_version=$(grep "^nodejs\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
4949
echo "python_version=$(grep "^python\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
5050
echo "terraform_version=$(grep "^terraform\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
51-
# TODO: Get the version, but it may not be the .version file as this should come from the CI/CD Pull Request Workflow
51+
# Future improvement: get the version from the CI/CD pull request workflow rather than assuming `.version`
5252
echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)" >> $GITHUB_OUTPUT
5353
# echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
5454
- name: "List variables"
@@ -71,7 +71,7 @@ jobs:
7171
needs: metadata
7272
steps:
7373
- name: "Checkout code"
74-
uses: actions/checkout@v4
74+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7575

7676
- name: "Get version"
7777
id: get-asset-version
@@ -104,7 +104,7 @@ jobs:
104104
run: |
105105
gh release download ${{steps.get-asset-version.outputs.release_version}} -p jekyll-docs-*.tar --output artifact.tar
106106
107-
- uses: actions/upload-artifact@v4
107+
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
108108
with:
109109
name: jekyll-docs-${{steps.get-asset-version.outputs.release_version}}
110110
path: artifact.tar

.github/workflows/pr_closed.disabled

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050

5151
steps:
5252
- name: Checkout repository
53-
uses: actions/checkout@v5.0.0
53+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5454

5555
- name: Updating Main Environment
5656
env:

.github/workflows/pr_closed.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ jobs:
4343
packages: read
4444
steps:
4545
- name: Checkout code
46-
uses: actions/checkout@v5.0.0
46+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4747

4848
- name: Setup NodeJS
49-
uses: actions/setup-node@v4
49+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
5050
with:
5151
node-version: ${{ inputs.nodejs_version }}
5252
registry-url: 'https://npm.pkg.github.com'
@@ -80,9 +80,9 @@ jobs:
8080
packages: read
8181
steps:
8282
- name: "Checkout code"
83-
uses: actions/checkout@v5.0.0
83+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8484
- name: Setup NodeJS
85-
uses: actions/setup-node@v4
85+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
8686
with:
8787
node-version: ${{ inputs.nodejs_version }}
8888
registry-url: 'https://npm.pkg.github.com'
@@ -108,10 +108,10 @@ jobs:
108108

109109
steps:
110110
- name: Checkout code
111-
uses: actions/checkout@v5.0.0
111+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
112112

113113
- name: Setup NodeJS
114-
uses: actions/setup-node@v4
114+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
115115
with:
116116
node-version: ${{ inputs.nodejs_version }}
117117
registry-url: 'https://npm.pkg.github.com'

.github/workflows/release-ddb-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1717

1818
- name: Read Node version
1919
id: versions
@@ -40,7 +40,7 @@ jobs:
4040
4141
- name: Upload bundle as workflow artifact
4242
if: github.event_name != 'release'
43-
uses: actions/upload-artifact@v4
43+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
4444
with:
4545
name: ddb-publish-bundle
4646
path: "${{ steps.bundle.outputs.tarball-path }}"

0 commit comments

Comments
 (0)