Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ on:
branches:
- main

permissions:
id-token: write
contents: read

jobs:
build:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
Expand All @@ -19,6 +20,4 @@ jobs:
registry-url: "https://registry.npmjs.org"
- run: npm install
- run: npm run release
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- run: npm publish

Copilot AI Dec 1, 2025

Copy link

Choose a reason for hiding this comment

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

The removal of NODE_AUTH_TOKEN from the npm publish step may cause authentication failures unless npm is configured to use provenance-based publishing with OIDC (which the id-token: write permission suggests).

Ensure that:

  1. The npm package is configured to accept provenance-based publishing
  2. The GitHub Actions environment is properly set up for OIDC authentication with npm
  3. The package repository settings on npm allow for this authentication method

If provenance publishing is not set up, the npm publish command will fail with an authentication error. Consider adding --provenance flag to the publish command to explicitly enable provenance: npm publish --provenance

Suggested change
- run: npm publish
- run: npm publish --provenance

Copilot uses AI. Check for mistakes.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
const semver = require("semver");
const spawn = require("cross-spawn");

const recommendeVersion: number = 22;
const recommendedVersion: number = 22;
const version: string = process.versions.node;
if (recommendeVersion > parseInt(version.split(".")[0])) {
if (recommendedVersion > parseInt(version.split(".")[0])) {
pc.red(`You are running Node Version:${version}.
View Generator requires Node ${recommendeVersion} or higher.
View Generator requires Node ${recommendedVersion} or higher.
Please update your version of Node.`);
process.exit(1);
}
Expand Down Expand Up @@ -87,7 +87,7 @@
let childOutput: string = "";
try {
childOutput = spawn.sync("npm", ["config", "list"]).output.join("");
} catch (err) {

Check warning on line 90 in src/index.ts

View workflow job for this annotation

GitHub Actions / windows-browser-test

'err' is defined but never used

Check warning on line 90 in src/index.ts

View workflow job for this annotation

GitHub Actions / macos-browser-test

'err' is defined but never used

Check warning on line 90 in src/index.ts

View workflow job for this annotation

GitHub Actions / macos-browser-test

'err' is defined but never used

Check warning on line 90 in src/index.ts

View workflow job for this annotation

GitHub Actions / windows-browser-test

'err' is defined but never used
return true;
}

Expand Down Expand Up @@ -155,7 +155,7 @@
try {
npmVersion = execSync("npm --version").toString().trim();
hasMinNpm = semver.gte(npmVersion, "10.0.0");
} catch (err) {

Check warning on line 158 in src/index.ts

View workflow job for this annotation

GitHub Actions / windows-browser-test

'err' is defined but never used

Check warning on line 158 in src/index.ts

View workflow job for this annotation

GitHub Actions / macos-browser-test

'err' is defined but never used

Check warning on line 158 in src/index.ts

View workflow job for this annotation

GitHub Actions / macos-browser-test

'err' is defined but never used

Check warning on line 158 in src/index.ts

View workflow job for this annotation

GitHub Actions / windows-browser-test

'err' is defined but never used
// ignore
}

Expand Down