From b8e6c4716ca863da92707a999dd171edb7c0ac4f Mon Sep 17 00:00:00 2001 From: Chris Walters Date: Fri, 10 Apr 2026 06:41:45 +0100 Subject: [PATCH] fix: replace secrets: inherit with explicit secret mappings in CI/CD workflows --- .github/workflows/cicd-1-pull-request.yaml | 11 +++++++---- .github/workflows/stage-1-commit.yaml | 13 +++++++++++++ .github/workflows/stage-2-test.yaml | 4 ++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cicd-1-pull-request.yaml b/.github/workflows/cicd-1-pull-request.yaml index 89760534..0c31f7d0 100644 --- a/.github/workflows/cicd-1-pull-request.yaml +++ b/.github/workflows/cicd-1-pull-request.yaml @@ -78,7 +78,11 @@ jobs: python_version: "${{ needs.metadata.outputs.python_version }}" terraform_version: "${{ needs.metadata.outputs.terraform_version }}" version: "${{ needs.metadata.outputs.version }}" - secrets: inherit + secrets: + IDP_AWS_REPORT_UPLOAD_ACCOUNT_ID: ${{ secrets.IDP_AWS_REPORT_UPLOAD_ACCOUNT_ID }} + IDP_AWS_REPORT_UPLOAD_REGION: ${{ secrets.IDP_AWS_REPORT_UPLOAD_REGION }} + IDP_AWS_REPORT_UPLOAD_ROLE_NAME: ${{ secrets.IDP_AWS_REPORT_UPLOAD_ROLE_NAME }} + IDP_AWS_REPORT_UPLOAD_BUCKET_ENDPOINT: ${{ secrets.IDP_AWS_REPORT_UPLOAD_BUCKET_ENDPOINT }} test-stage: # Recommended maximum execution time is 5 minutes name: "Test stage" needs: [metadata, commit-stage] @@ -91,7 +95,8 @@ jobs: python_version: "${{ needs.metadata.outputs.python_version }}" terraform_version: "${{ needs.metadata.outputs.terraform_version }}" version: "${{ needs.metadata.outputs.version }}" - secrets: inherit + secrets: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} build-stage: # Recommended maximum execution time is 3 minutes name: "Build stage" needs: [metadata, test-stage] @@ -105,7 +110,6 @@ jobs: python_version: "${{ needs.metadata.outputs.python_version }}" terraform_version: "${{ needs.metadata.outputs.terraform_version }}" version: "${{ needs.metadata.outputs.version }}" - secrets: inherit acceptance-stage: # Recommended maximum execution time is 10 minutes name: "Acceptance stage" needs: [metadata, build-stage] @@ -119,4 +123,3 @@ jobs: python_version: "${{ needs.metadata.outputs.python_version }}" terraform_version: "${{ needs.metadata.outputs.terraform_version }}" version: "${{ needs.metadata.outputs.version }}" - secrets: inherit diff --git a/.github/workflows/stage-1-commit.yaml b/.github/workflows/stage-1-commit.yaml index 2a75c738..c660701f 100644 --- a/.github/workflows/stage-1-commit.yaml +++ b/.github/workflows/stage-1-commit.yaml @@ -31,6 +31,19 @@ on: description: "Version of the software, set by the CI/CD pipeline workflow" required: true type: string + secrets: + IDP_AWS_REPORT_UPLOAD_ACCOUNT_ID: + description: "AWS account ID for IDP report upload" + required: false + IDP_AWS_REPORT_UPLOAD_REGION: + description: "AWS region for IDP report upload" + required: false + IDP_AWS_REPORT_UPLOAD_ROLE_NAME: + description: "AWS IAM role name for IDP report upload" + required: false + IDP_AWS_REPORT_UPLOAD_BUCKET_ENDPOINT: + description: "AWS S3 bucket endpoint for IDP report upload" + required: false jobs: scan-secrets: diff --git a/.github/workflows/stage-2-test.yaml b/.github/workflows/stage-2-test.yaml index 5ce744c3..08775d67 100644 --- a/.github/workflows/stage-2-test.yaml +++ b/.github/workflows/stage-2-test.yaml @@ -31,6 +31,10 @@ on: description: "Version of the software, set by the CI/CD pipeline workflow" required: true type: string + secrets: + SONAR_TOKEN: + description: "SonarCloud token for static analysis" + required: true jobs: test-unit: