Skip to content

Fix NPM access to packages in GitHub package registry#285

Merged
m-houston merged 15 commits intomainfrom
feature/fix-github-npm-registry-access
Dec 5, 2025
Merged

Fix NPM access to packages in GitHub package registry#285
m-houston merged 15 commits intomainfrom
feature/fix-github-npm-registry-access

Conversation

@m-houston
Copy link
Copy Markdown
Contributor

@m-houston m-houston commented Dec 5, 2025

Description

In order to direct package installs for @NHSDigital packages to the github package registry, we need to include it in the .npmrc file

Additionally, the CI workflow needs to be told to use the GITHUB_TOKEN for access to the relevant scope, which seems to be handled by the setup node action if you pass in the registry and provide the correct environment vars.

I've added a check to the commit workflow which runs if the schema changes: if the currently package.json version matches an already published version of the schemas then it will fail early, as otherwise this would fail during publishing when the pr_closed workflow runs.

You can see a forced run of this step failing (as intended) here.

Context

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.

@m-houston m-houston requested review from a team as code owners December 5, 2025 10:22
@m-houston m-houston force-pushed the feature/fix-github-npm-registry-access branch from ea575c7 to 5741a86 Compare December 5, 2025 12:12
@m-houston m-houston changed the title Add GitHub NPM registry configuration to .npmrc Fix NPM access to packages in GitHub package registry Dec 5, 2025
@m-houston m-houston merged commit ecc786b into main Dec 5, 2025
60 of 61 checks passed
@m-houston m-houston deleted the feature/fix-github-npm-registry-access branch December 5, 2025 16:14
masl2 pushed a commit that referenced this pull request Jan 5, 2026
* Add GitHub NPM registry configuration to .npmrc

* Add version check and Node.js setup to CI workflow

* Refactor event schema version checks in CI workflow

* Add GitHub NPM registry URL to Node.js setup in workflows

* Add NODE_AUTH_TOKEN to GitHub Actions environment for NPM access

* Revert "Add GitHub NPM registry URL to Node.js setup in workflows"

* Move NODE_AUTH_TOKEN to npm view step in CI workflow

* Add NODE_AUTH_TOKEN to NPM install steps in workflows

* Add NODE_AUTH_TOKEN input for GitHub package registry access in workflows

* Add packages:read to permissions

Signed-off-by: Mark Slowey <mark.slowey1@nhs.net>
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