Skip to content

Chore: [AEA-6424] - new quality checks#493

Merged
anthony-nhs merged 4 commits intomainfrom
new_qc
Apr 13, 2026
Merged

Chore: [AEA-6424] - new quality checks#493
anthony-nhs merged 4 commits intomainfrom
new_qc

Conversation

@anthony-nhs
Copy link
Copy Markdown
Contributor

@anthony-nhs anthony-nhs commented Apr 8, 2026

Summary

  • Routine Change

Details

  • move to new quality checks

Copilot AI review requested due to automatic review settings April 8, 2026 16:40
Copy link
Copy Markdown

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 tightens repository quality/security tooling by adding local vulnerability scanning and hardening GitHub Actions workflows with explicit permissions, alongside related housekeeping updates.

Changes:

  • Add zizmor.yml rule ignores to suppress known/accepted findings.
  • Add a local pre-commit hook to run make grype-scan-local, and ignore generated SBOM output.
  • Harden/refresh GitHub Actions workflows (explicit permissions: {}, updated reusable workflow refs, safer checkout settings) and add CODEOWNERS for workflow approval control.

Reviewed changes

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

Show a summary per file
File Description
zizmor.yml Adds rule ignore configuration for zizmor findings.
.pre-commit-config.yaml Adds a local pre-commit hook to run Grype scanning via make.
.gitignore Ignores .sbom/ output directory.
.github/workflows/sync_copilot.yml Sets default workflow permissions to none.
.github/workflows/sam_release_code.yml Adds default no-permissions and tweaks checkout credential persistence.
.github/workflows/sam_package_code.yml Adds default no-permissions and tweaks checkout credential persistence.
.github/workflows/release.yml Updates reusable workflow SHAs and moves to explicit permissions model.
.github/workflows/pull_request.yml Updates reusable workflow SHAs and moves to explicit permissions model.
.github/workflows/delete_old_cloudformation_stacks.yml Sets default workflow permissions to none and hardens checkout.
.github/workflows/ci.yml Updates reusable workflow SHAs and moves to explicit permissions model.
.github/CODEOWNERS Restricts approvals for workflow changes to @NHSDigital/eps-admins.
.devcontainer/devcontainer.json Bumps devcontainer base image version.


env:
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
permissions: {}
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

With workflow-level permissions: {} the default GITHUB_TOKEN permissions are none. Jobs like get_issue_number (uses actions/github-script to call the PR/commit APIs) and release_code (calls reusable workflow sam_release_code.yml, which needs at least id-token: write and contents: read) currently don't set job-level permissions, so they will inherit none and likely fail with 403 / OIDC token errors. Add explicit permissions blocks to those jobs (e.g. pull-requests: read for get_issue_number, and id-token: write + contents: read (or contents: write if needed) for release_code).

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml

env:
BRANCH_NAME: ${{ github.event.ref.BRANCH_NAME }}
permissions: {}
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

With workflow-level permissions: {} the jobs that call the reusable workflow sam_release_code.yml (e.g. release_dev, release_qa) currently don't declare job-level permissions. Reusable workflows cannot elevate permissions above the caller, so sam_release_code.yml won't actually get the id-token / contents permissions it requests and AWS/OIDC + checkout/push steps can fail. Add explicit job-level permissions to each uses: ./.github/workflows/sam_release_code.yml job (at minimum id-token: write and contents: write if gh-pages updates are required).

Suggested change
permissions: {}
permissions:
contents: write
id-token: write

Copilot uses AI. Check for mistakes.

env:
BRANCH_NAME: ${{ github.event.ref.BRANCH_NAME }}
permissions: {}
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

With workflow-level permissions: {} the release_* jobs that call the reusable workflow sam_release_code.yml don't declare job-level permissions. Because called workflows cannot elevate permissions beyond the caller, sam_release_code.yml will run without the id-token / contents permissions it needs for OIDC AWS auth, checkout, and gh-pages updates. Add explicit permissions blocks to each release_* job (at minimum id-token: write and contents: write).

Copilot uses AI. Check for mistakes.
Comment thread .github/CODEOWNERS
Comment on lines +1 to +2
# restrict access to approving workflow changes
.github/workflows/ @NHSDigital/eps-admins
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The PR description still contains the placeholder/template sections (e.g. "Remove items from this list...", PR naming guidance). Please update it to reflect the actual change and remove the template text so the merge commit message/changelog entry is meaningful.

Copilot uses AI. Check for mistakes.
@anthony-nhs anthony-nhs changed the title Chore: [AEA-0000] - new qc Chore: [AEA-6424] - new quality checks Apr 13, 2026
@sonarqubecloud
Copy link
Copy Markdown

@anthony-nhs anthony-nhs merged commit ebf7166 into main Apr 13, 2026
28 of 29 checks passed
@anthony-nhs anthony-nhs deleted the new_qc branch April 13, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants