Skip to content

CCM-14828: Make build-docs action use GITHUB_TOKEN - #233

Merged
gareth-allan merged 3 commits into
mainfrom
feature/CCM-14828_build_docs_pnpm_version
Jul 22, 2026
Merged

CCM-14828: Make build-docs action use GITHUB_TOKEN#233
gareth-allan merged 3 commits into
mainfrom
feature/CCM-14828_build_docs_pnpm_version

Conversation

@gareth-allan

@gareth-allan gareth-allan commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Description

Allows a GITHUB_TOKEN value to be passed to the build-docs action, as it runs a pnpm install, which for some repos can require access to private package repositories.

Changes:

  • Updated .github/actions/build-docs/action.yml to optionally accept a GITHUB_TOKEN input and run scripts/set-github-token.sh if it is set
  • Added scripts/set-github-token.sh to use the value of GITHUB_TOKEN to set up pnpm auth
  • Added ruby to the .tool-versions file, as make config fails otherwise

Context

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_TOKEN for scenarios that need to access private repositories.

Validation

With GITHUB_TOKEN Set

A 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

Screenshot 2026-07-22 at 12 01 02

It also runs the set-github-token.sh script with a GITHUB_TOKEN value:
Screenshot 2026-07-22 at 14 39 39

Without GITHUB_TOKEN Set

Created 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
Screenshot 2026-07-22 at 15 54 02

It does not run the set-github-token.sh script:
Screenshot 2026-07-22 at 15 52 43

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

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.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

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 gareth-allan changed the title CCM 14828: Make build-docs action use GITHUB_TOKEN CCM-14828: Make build-docs action use GITHUB_TOKEN Jul 21, 2026
@gareth-allan
gareth-allan marked this pull request as ready for review July 22, 2026 15:05
@gareth-allan
gareth-allan requested a review from a team as a code owner July 22, 2026 15:05
@gareth-allan
gareth-allan merged commit 6fc87b9 into main Jul 22, 2026
29 checks passed
@gareth-allan
gareth-allan deleted the feature/CCM-14828_build_docs_pnpm_version branch July 22, 2026 15: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.

3 participants