Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/create-lines-of-code-report/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ runs:
run: zip lines-of-code-report.json.zip lines-of-code-report.json
- name: "Upload CLOC report as an artefact"
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: lines-of-code-report.json.zip
path: ./lines-of-code-report.json.zip
Expand All @@ -44,7 +44,7 @@ runs:
echo "secrets_exist=${{ inputs.idp_aws_report_upload_role_name != '' && inputs.idp_aws_report_upload_bucket_endpoint != '' }}" >> $GITHUB_OUTPUT
- name: "Authenticate to send the report"
if: steps.check.outputs.secrets_exist == 'true'
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::${{ inputs.idp_aws_report_upload_account_id }}:role/${{ inputs.idp_aws_report_upload_role_name }}
aws-region: ${{ inputs.idp_aws_report_upload_region }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/create-sbom-report/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
bash ${GITHUB_WORKSPACE}/templates/scripts/reports/create-sbom-report.sh

- name: Upload SBOM report as an artefact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ inputs.image_name }}-sbom
path: ${{ inputs.image_name }}-sbom.json
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/scan-dependencies/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ runs:
run: zip sbom-repository-report.json.zip sbom-repository-report.json
- name: "Upload SBOM report as an artefact"
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: sbom-repository-report.json.zip
path: ./sbom-repository-report.json.zip
Expand All @@ -47,7 +47,7 @@ runs:
run: zip vulnerabilities-repository-report.json.zip vulnerabilities-repository-report.json
- name: "Upload vulnerabilities report as an artefact"
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: vulnerabilities-repository-report.json.zip
path: ./vulnerabilities-repository-report.json.zip
Expand All @@ -58,7 +58,7 @@ runs:
run: echo "secrets_exist=${{ inputs.idp_aws_report_upload_role_name != '' && inputs.idp_aws_report_upload_bucket_endpoint != '' }}" >> $GITHUB_OUTPUT
- name: "Authenticate to send the reports"
if: steps.check.outputs.secrets_exist == 'true'
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::${{ inputs.idp_aws_report_upload_account_id }}:role/${{ inputs.idp_aws_report_upload_role_name }}
aws-region: ${{ inputs.idp_aws_report_upload_region }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/scan-vulnerabilities/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ runs:
done

- name: Upload vulnerabilities report
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ inputs.image_name }}-vulnerabilities
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cicd-1-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
docker_file_exists: ${{ steps.check_compose.outputs.docker_file_exists }}
steps:
- name: "Checkout code"
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: "Set CI/CD variables"
id: variables
run: |
Expand Down
25 changes: 2 additions & 23 deletions .github/workflows/cicd-2-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
version: ${{ steps.variables.outputs.version }}
steps:
- name: "Checkout code"
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: "Set CI/CD variables"
id: variables
run: |
Expand Down Expand Up @@ -53,32 +53,11 @@ jobs:
timeout-minutes: 3
steps:
- name: "Checkout code"
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: "Get the artefacts"
run: |
echo "Getting the artefacts created by the build stage ..."
# TODO: Use either action/cache or action/upload-artifact
- name: "Create release"
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.metadata.outputs.version }}
release_name: Release ${{ needs.metadata.outputs.version }}
body: |
Release of ${{ needs.metadata.outputs.version }}
draft: false
prerelease: false
# - name: "Upload release asset"
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: "${{ steps.create_release.outputs.upload_url }}"
# asset_path: ./*
# asset_name: repository-template-${{ needs.metadata.outputs.version }}.tar.gz
# asset_content_type: "application/gzip"
success:
name: "Success notification"
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cicd-3-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
tag: ${{ steps.variables.outputs.tag }}
steps:
- name: "Checkout code"
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: "Set CI/CD variables"
id: variables
run: |
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
timeout-minutes: 10
steps:
- name: "Checkout code"
uses: actions/checkout@v4
uses: actions/checkout@v6
# TODO: More jobs or/and steps here
# success:
# name: "Success notification"
Expand All @@ -68,7 +68,7 @@ jobs:
# run: echo "secret_exist=${{ secrets.TEAMS_NOTIFICATION_WEBHOOK_URL != '' }}" >> $GITHUB_OUTPUT
# - name: "Notify on deployment to an environment"
# if: steps.check.outputs.secret_exist == 'true'
# uses: nhs-england-tools/notify-msteams-action@v0.0.4
# uses: nhs-england-tools/notify-msteams-action@v1.0.0
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# teams-webhook-url: ${{ secrets.TEAMS_NOTIFICATION_WEBHOOK_URL }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/stage-1-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
timeout-minutes: 2
steps:
- name: "Checkout code"
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0 # Full history is needed to scan all commits
- name: "Scan secrets"
Expand All @@ -50,7 +50,7 @@ jobs:
timeout-minutes: 2
steps:
- name: "Checkout code"
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0 # Full history is needed to compare branches
- name: "Check file format"
Expand All @@ -61,7 +61,7 @@ jobs:
# timeout-minutes: 2
# steps:
# - name: "Checkout code"
# uses: actions/checkout@v4
# uses: actions/checkout@v6
# with:
# fetch-depth: 0 # Full history is needed to compare branches
# - name: "Check Markdown format"
Expand All @@ -72,7 +72,7 @@ jobs:
# timeout-minutes: 2
# steps:
# - name: "Checkout code"
# uses: actions/checkout@v4
# uses: actions/checkout@v6
# with:
# fetch-depth: 0 # Full history is needed to compare branches
# - name: "Check English usage"
Expand All @@ -83,7 +83,7 @@ jobs:
timeout-minutes: 2
steps:
- name: "Checkout code"
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: "Lint Terraform"
uses: ./.github/actions/lint-terraform
count-lines-of-code:
Expand All @@ -95,7 +95,7 @@ jobs:
timeout-minutes: 2
steps:
- name: "Checkout code"
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: "Count lines of code"
uses: ./.github/actions/create-lines-of-code-report
with:
Expand All @@ -114,7 +114,7 @@ jobs:
timeout-minutes: 2
steps:
- name: "Checkout code"
uses: actions/checkout@v4
uses: actions/checkout@v6
# - name: "Scan dependencies"
# uses: ./.github/actions/scan-dependencies
# with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/stage-2-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
timeout-minutes: 5
steps:
- name: "Checkout code"
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: "Run unit test suite"
run: |
make test-unit
Expand All @@ -52,7 +52,7 @@ jobs:
timeout-minutes: 5
steps:
- name: "Checkout code"
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: "Run linting"
run: |
make test-lint
Expand All @@ -66,7 +66,7 @@ jobs:
timeout-minutes: 5
steps:
- name: "Checkout code"
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: "Run test coverage check"
run: |
make test-coverage
Expand All @@ -80,9 +80,9 @@ jobs:
timeout-minutes: 5
steps:
- name: "Checkout code"
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Install Terraform
uses: hashicorp/setup-terraform@v3
uses: hashicorp/setup-terraform@v4
with:
terraform_version: 1.12.2
- name: "run the tests"
Expand All @@ -99,7 +99,7 @@ jobs:
timeout-minutes: 5
steps:
- name: "Checkout code"
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0 # Full history is needed to improving relevancy of reporting
- name: "Perform static analysis"
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/stage-3-build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ jobs:
FUNC_NAMES: ${{ steps.get-function-names.outputs.FUNC_NAMES }}
DOCKER_COMPOSE_DIR: ${{ steps.get-function-names.outputs.DOCKER_COMPOSE_DIR }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 2
token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout dtos-devops-templates repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: NHSDigital/dtos-devops-templates
path: templates
Expand Down Expand Up @@ -82,22 +82,22 @@ jobs:
pr_num_tag: ${{ env.PR_NUM_TAG }}
short_commit_hash: ${{ env.COMMIT_HASH_TAG }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 1
submodules: 'true'

- name: Checkout dtos-devops-templates repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: NHSDigital/dtos-devops-templates
path: templates
ref: main

- name: Az CLI login
if: github.ref == 'refs/heads/main'
uses: azure/login@v2
uses: azure/login@v3
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
Expand Down Expand Up @@ -222,7 +222,7 @@ jobs:
zip "${SBOM_REPOSITORY_REPORT}.json.zip" "${SBOM_REPOSITORY_REPORT}.json"

- name: Upload SBOM report as an artefact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ env.SBOM_REPOSITORY_REPORT }}.json.zip
path: ./${{ env.SBOM_REPOSITORY_REPORT }}.json.zip
Expand All @@ -235,14 +235,14 @@ jobs:
zip ${VULNERABILITIES_REPOSITORY_REPORT}.json.zip ${VULNERABILITIES_REPOSITORY_REPORT}.json

- name: Upload vulnerabilities report as an artefact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ env.VULNERABILITIES_REPOSITORY_REPORT }}.json.zip
path: ./${{ env.VULNERABILITIES_REPOSITORY_REPORT }}.json.zip
retention-days: 21

- name: Upload vulnerabilities summary report as an artefact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ env.VULNERABILITIES_SUMMARY_LOGFILE }}
path: ./${{ env.VULNERABILITIES_SUMMARY_LOGFILE }}
Expand All @@ -253,7 +253,7 @@ jobs:
needs: build-and-push
steps:
- name: Download SBOM JSON artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
path: ./downloaded-artifacts

Expand All @@ -267,13 +267,13 @@ jobs:
zip vulnerabilities-repository-report-${{ needs.build-and-push.outputs.PR_NUM_TAG }}.zip downloaded-artifacts/**/*vulnerabilities-summary*.txt

- name: Upload sbom zip file
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: aggregated-sbom-repository-report-${{ needs.build-and-push.outputs.PR_NUM_TAG }}.zip
path: sbom-repository-report-${{ needs.build-and-push.outputs.PR_NUM_TAG }}.zip

- name: Upload repository zip file
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: aggregated-vulnerabilities-repository-report-${{ needs.build-and-push.outputs.PR_NUM_TAG }}.zip
path: vulnerabilities-repository-report-${{ needs.build-and-push.outputs.PR_NUM_TAG }}.zip
Loading