Repository navigation
ci: publish releases to npm, add CodeQL and OpenSSF Scorecard - #10
Merged
Merged
Conversation
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
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.
What does this PR do?
Adds release automation and supply-chain checks.
publish.yml: runs when a GitHub release is published (or manually, with a dry-run switch that defaults to on). It checks that the release tag equalsv+ thepackage.jsonversion and fails otherwise, runsnode build.js, fails if the committed build output is out of date (the same check as CI) and lists the packed files, thennpm publish --provenance --access public. Permissions arecontents: readandid-token: write; Node 24 ships an npm that supports trusted publishing, and the setup-node cache is off in this job.codeql.yml: CodeQL for JavaScript/TypeScript (default queries,build-mode: none) on pushes and PRs tomainand weekly. Code scanning default setup is not enabled on this repo, so this is the only CodeQL config.scorecard.yml: OpenSSF Scorecard (ossf/scorecard-action@v2.4.4) on pushes tomain, branch protection changes and weekly, withpublish_results: true, a SARIF artifact and a code-scanning upload. The README gets the Scorecard badge.vX.Y.Zrelease, the workflow publishes).Publish and Scorecard don't run on pull requests (release/dispatch and default-branch only), so their first runs happen after merge.
One-time setup before the first automated release
The workflow authenticates with npm trusted publishing (OIDC), so no
NPM_TOKENsecret is needed. On npmjs.com, open the package's Settings → Trusted Publisher → GitHub Actions and enter:fadyehabamerNYXpublish.ymlnpm publishOr from a terminal with npm 11.15+ and 2FA enabled:
Afterwards, Settings → Publishing access → "Require two-factor authentication and disallow tokens" is recommended; trusted publishing keeps working.
Notes: the repo has no dependencies and no
package-lock.json, so the publish job skipsnpm ci, sincenpm cifails without a lockfile. GitHub release v1.1.0 exists but npm is still on 1.0.3, and that tag predates this workflow. Publish 1.1.0 by hand, or ship the next version through a release. Use a lowercasevfor tags: the oldV1.0.3style would fail the tag check.