Skip to content

LCS-867 Review sonarqube vulnerabilities in github pipelines part2#461

Merged
mrlockstar merged 4 commits intomainfrom
LCS-867-Review-sonarqube-vulnerabilities-in-github-pipelines-part2
May 8, 2026
Merged

LCS-867 Review sonarqube vulnerabilities in github pipelines part2#461
mrlockstar merged 4 commits intomainfrom
LCS-867-Review-sonarqube-vulnerabilities-in-github-pipelines-part2

Conversation

@mrlockstar
Copy link
Copy Markdown
Contributor

@mrlockstar mrlockstar commented May 7, 2026

What is the change?

This PR implements several improvements based on SonarQube recommendations, including security fixes, code reliability enhancements, and general refactoring for better reusability.

Although the original scope was focused on security, it made sense to address related quality improvements at the same time.

Please note that this will not resolve all the issues; its more a second pass at fixing them. More PRs will follow.

I have also included the 500 error alert into this PR as it was previously broken.

Why are we making this change?

To ensure the repository can remain public while adhering to SonarQube best practices, particularly around security, maintainability, and code quality.

@mrlockstar mrlockstar force-pushed the LCS-867-Review-sonarqube-vulnerabilities-in-github-pipelines-part2 branch from 301ccc0 to 82e952d Compare May 7, 2026 11:03
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

The review app is available at this URL:
https://pr-461.non-live.digital-lung-cancer-screening.nhs.uk/
You must authenticate with HTTP basic authentication. Ask the team for credentials.

@mrlockstar mrlockstar changed the title Fix the 500 error alert LCS-867 Review-sonarqube-vulnerabilities-in-github-pipelines-part2 May 7, 2026
@mrlockstar mrlockstar changed the title LCS-867 Review-sonarqube-vulnerabilities-in-github-pipelines-part2 LCS-867 Review sonarqube vulnerabilities in github pipelines part2 May 7, 2026
@mrlockstar mrlockstar force-pushed the LCS-867-Review-sonarqube-vulnerabilities-in-github-pipelines-part2 branch from d0699c5 to 8a02edd Compare May 7, 2026 12:33
Comment thread .github/actions/create-lines-of-code-report/action.yaml Fixed
@mrlockstar mrlockstar force-pushed the LCS-867-Review-sonarqube-vulnerabilities-in-github-pipelines-part2 branch from d1d8636 to c7abfe4 Compare May 7, 2026 15:45
@stephhou stephhou requested a review from Copilot May 7, 2026 16:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is a second pass at addressing SonarQube findings by reducing secret exposure in reusable GitHub Actions workflows, refactoring a composite action’s environment handling, and re-enabling a previously broken “500 error” alert in Terraform.

Changes:

  • Replaced secrets: inherit with explicit secret mappings / declared required secrets for reusable workflows.
  • Re-enabled and updated the scheduled query alert Terraform resource for error detection.
  • Refactored the CLOC report composite action to pass values via env: instead of inline exports.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
infrastructure/modules/container-apps/alerts.tf Re-enabled the scheduled query alert resource and updated scopes/query.
.github/workflows/stage-5-deploy.yaml Declared required Azure secrets for the reusable deploy workflow.
.github/workflows/stage-2-test.yaml Declared required SONAR_TOKEN secret for the reusable test workflow.
.github/workflows/stage-1-commit.yaml Declared required AWS report-upload secrets for the reusable commit workflow.
.github/workflows/cicd-2-main-branch.yaml Replaced inherited secrets with explicit secret mapping (currently mismatched for commit stage).
.github/workflows/cicd-1-pull-request.yaml Replaced inherited secrets with explicit secret mapping.
.github/actions/create-lines-of-code-report/action.yaml Refactored env handling and adjusted S3 upload destination construction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/cicd-2-main-branch.yaml Outdated
Comment thread infrastructure/modules/container-apps/alerts.tf
Comment thread .github/actions/create-lines-of-code-report/action.yaml Outdated
Comment thread .github/actions/create-lines-of-code-report/action.yaml Outdated
@mrlockstar mrlockstar force-pushed the LCS-867-Review-sonarqube-vulnerabilities-in-github-pipelines-part2 branch from be333e6 to ac7fc67 Compare May 8, 2026 09:20
@mrlockstar mrlockstar enabled auto-merge May 8, 2026 10:11
@stephhou stephhou requested a review from Copilot May 8, 2026 10:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread .github/actions/create-lines-of-code-report/action.yaml Outdated
Comment thread infrastructure/modules/container-apps/alerts.tf
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Alastair Lock <alastair.lock@gmail.com>
@mrlockstar mrlockstar force-pushed the LCS-867-Review-sonarqube-vulnerabilities-in-github-pipelines-part2 branch from ac7fc67 to 9027567 Compare May 8, 2026 10:34
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 2026

@mrlockstar mrlockstar merged commit ab96ba4 into main May 8, 2026
28 checks passed
@mrlockstar mrlockstar deleted the LCS-867-Review-sonarqube-vulnerabilities-in-github-pipelines-part2 branch May 8, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants