CCM-14828: Make build-docs action use GITHUB_TOKEN - #233
Merged
Conversation
pre-commit installed at .git/hooks/pre-commit act gitleaks jq nodejs pnpm pre-commit terraform terraform-docs trivy vale python ruby pnpm --ignore-workspace install --frozen-lockfile Lockfile is up to date, resolution step is skipped Already up to date Done in 415ms using pnpm v10.33.0 bundle config set --local path vendor/bundle bundle install Bundle complete! 10 Gemfile dependencies, 56 gems now installed. Bundled gems are installed into `./vendor/bundle` command
gareth-allan
marked this pull request as ready for review
July 22, 2026 15:05
aidenvaines-cgi
approved these changes
Jul 22, 2026
simonlabarere
approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Allows a
GITHUB_TOKENvalue to be passed to the build-docs action, as it runs apnpm install, which for some repos can require access to private package repositories.Changes:
.github/actions/build-docs/action.ymlto optionally accept aGITHUB_TOKENinput and runscripts/set-github-token.shif it is setscripts/set-github-token.shto use the value ofGITHUB_TOKENto set up pnpm authrubyto the.tool-versionsfile, asmake configfails otherwiseContext
This change is required as the build-docs action was failing when Digital Letters was updated to pnpm 11. I believe this is because pnpm 11 has changed the dependency resolution logic, so now tries to resolve the dependencies from our private repos, where pnpm 10 didn't (likely because the install command is only targeting a subset of the workspaces).
Regardless, I think it makes sense that this job supports setting a
GITHUB_TOKENfor scenarios that need to access private repositories.Validation
With
GITHUB_TOKENSetA branch of the Digital Letters repo, updated to use pnpm 11 and this version of the build-docs action builds successfully: https://github.com/NHSDigital/nhs-notify-digital-letters/actions/runs/29849968982
It also runs the set-github-token.sh script with a

GITHUB_TOKENvalue:Without
GITHUB_TOKENSetCreated a branch of the Digital Letters repo, updated to use this version of the build-docs action and with a small change to an event schema to trigger the build docs action, but with no other changes. Verified that it still builds successfully: https://github.com/NHSDigital/nhs-notify-digital-letters/actions/runs/29924834191/job/88942992852?pr=430

It does not run the

set-github-token.shscript:Type of changes
Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.