Update Node.js version and enhance workflow configuration - #101
Update Node.js version and enhance workflow configuration #101blytkerchan wants to merge 26 commits into
Conversation
blytkerchan
commented
Mar 16, 2026
- Update Node.js version to 24 in action.yml
- Add Visual Studio 2025 version mapping to VsYearVersion
- Add 'dev' and 'main' branches to push trigger in workflow
- Fix typos in action.yml and lib.js comments
- Add dependabot configuration for npm and GitHub Actions updates
- Update actions/checkout version to v6 in main workflow
- Update GitHub Actions workflow to support Visual Studio 2025 and 2026
- Add configurable support for ARM32 architecture (to disable it where not supported)
- Fix compilation commands for ARM architecture in main workflow (don't always expect exe)
- Remove Windows 2019 runner from workflow matrix -- no longer supported
* Update Node.js version to 24 in action.yml * Add Visual Studio 2025 version mapping to VsYearVersion * Add 'dev' and 'main' branches to push trigger in workflow * Fix typos in action.yml and lib.js comments * Add dependabot configuration for npm and GitHub Actions updates * Update actions/checkout version to v6 in main workflow * Update GitHub Actions workflow to support Visual Studio 2025 and 2026 * Add configurable support for ARM32 architecture (to disable it where not supported) * Fix compilation commands for ARM architecture in main workflow (don't always expect exe) * Remove Windows 2019 runner from workflow matrix -- no longer supported
- Added @vercel/ncc as a devDependency in package.json - Updated the build script in package.json to use ncc for building the project - Updated package-lock.json to reflect the addition of @vercel/ncc
This is done here #94 |
|
Thank you for this PR, which made this fix very easy: steps:
- name: 'Install Visual Studio Build Tools'
- uses: ilammy/msvc-dev-cmd@v1
+ uses: ilammy/msvc-dev-cmd@138b1c783b65ec697d8342918306b7b2db4e88f1 |
|
Many projects use your GitHub action. If you no longer have the time or interest to maintain this project (which is perfectly fine), you could make another developer a collaborator who could continue the maintenance or help out for a certain period. The project would continue, and several people wouldn't have to create a fork. Imho that would be better for everyone (including you) than letting the project die. What do you think? I regularly contribute code to https://github.com/krakjoe/apcu, and this action is used there. Therefore, I would be happy if this project continues to work and I didn't have to worry about finding another solution... |
|
FWIW, I just found that someone has made their own forked MSVC action for some years and they are keeping maintaining it: https://github.com/TheMrMilchmann/setup-msvc-dev. I feel a little bit unhappy when I read the git-blame of that interesting "cls" hack: TheMrMilchmann/setup-msvc-dev::src/setup-msvc-dev.ts#L63-L64, which could be from ilammy/msvc-dev-cmd::index.js#L119. IIRC, MIT doesn't force anything about Git history, so I should calm down. However, we know that something is better than nothing. That's it. |
This comment was marked as outdated.
This comment was marked as outdated.
Someday you may want or need to build something with specific components, for example, an older Windows SDK. You need to call "vcvarsall.bat" and try to figure out how to persist those environment variables, then you see the core of this project.
. |
| @@ -12,6 +12,7 @@ const EDITIONS = ['Enterprise', 'Professional', 'Community', 'BuildTools'] | |||
| const YEARS = ['2022', '2019', '2017'] | |||
There was a problem hiding this comment.
| const YEARS = ['2022', '2019', '2017'] | |
| const YEARS = ['2026', '2022', '2019', '2017'] |
There was a problem hiding this comment.
There was a problem hiding this comment.
TBH, to me it looks like this change probably isn't necessary at the moment, because the year seems not to be part of the path in this VS version. But if this changes someday, it could be useful and it shouldn't harm.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR modernizes the JavaScript Action packaging and CI setup to support newer Visual Studio versions (including VS 2026), adds automated release/dependency tooling, and introduces unit tests to validate the action’s behavior.
Changes:
- Updates the action runtime/packaging to use a bundled
dist/index.jsentrypoint and newer Node.js runtime. - Expands CI matrices and logic to support newer Windows/Visual Studio runners and ARM behavior, and adds unit tests.
- Adds release automation (release-please) and dependency automation (Dependabot + optional automerge workflow).
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
test/lib.test.js |
Adds unit tests for VS version mapping, vswhere lookup, fallback search, and env var export logic. |
test/index.test.js |
Adds unit tests for the index.js entrypoint input wiring and error handling. |
test/helpers.js |
Adds a VM-based CommonJS loader helper to isolate modules and mock dependencies in tests. |
lib.js |
Adds VS 2026 mapping and fixes a comment typo; core logic remains the same. |
dist/index.js |
Adds bundled action output for action.yml to execute directly. |
action.yml |
Moves runtime to Node.js 24 and points action entry to dist/index.js; fixes “Spectre” typo. |
README.md |
Renames/repoints documentation to the forked action location and updates usage examples. |
package.json |
Adds build/test scripts and updates dependencies (e.g., @actions/core), introduces ncc. |
package-lock.json |
Updates lockfile to reflect dependency and devDependency changes. |
release-please-config.json |
Adds release-please configuration for node-style releases. |
.release-please-manifest.json |
Adds release-please manifest to track package versions. |
.github/workflows/main.yml |
Expands CI to multiple Windows runners/VS versions, adds ARM32 gating, and runs unit tests. |
.github/workflows/release.yml |
Updates checkout action version and aligns audit steps with npm ci usage. |
.github/workflows/release-please.yml |
Adds automated release PR + release creation workflow and tag-moving job. |
.github/workflows/ci_dependabot_automerge.yml |
Adds optional Dependabot automerge workflow for minor/patch updates. |
.github/dependabot.yml |
Configures Dependabot updates for npm and GitHub Actions on the dev branch. |
Comments suppressed due to low confidence (1)
package.json:14
package.jsonmetadata still points at the upstream repository, but this fork’s README states it publishes asvln-devsecops/actions-msvc. Updating therepository.urlavoids tooling (release-please, npm, GitHub UI links) sending users to the wrong repo.
"repository": {
"type": "git",
"url": "git+https://github.com/ilammy/msvc-dev-cmd.git"
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
|
|
||
| const EDITIONS = ['Enterprise', 'Professional', 'Community', 'BuildTools'] | ||
| const YEARS = ['2022', '2019', '2017'] |
| - uses: actions/checkout@v5 | ||
| - uses: vln-devsecops/actions-msvc@v1 |
| - uses: actions/checkout@v5 | ||
| - uses: vln-devsecops/actions-msvc@v1 |
| - name: Download Internet | ||
| run: npm install |
| - name: Download Internet | ||
| run: npm install |
| "bugs": { | ||
| "url": "https://github.com/ilammy/msvc-dev-cmd/issues" | ||
| }, | ||
| "homepage": "https://github.com/ilammy/msvc-dev-cmd#readme", |
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.13.1 to 3.15.0. - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](nodeca/js-yaml@3.13.1...3.15.0) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 3.15.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [flatted](https://github.com/WebReflection/flatted) from 3.2.2 to 3.4.2. - [Commits](WebReflection/flatted@v3.2.2...v3.4.2) --- updated-dependencies: - dependency-name: flatted dependency-version: 3.4.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
GITHUB_TOKEN cannot approve pull requests, so the approve/merge step needs a fine-grained PAT instead.
* Bump minimatch from 3.1.2 to 3.1.5 Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.5. - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](isaacs/minimatch@v3.1.2...v3.1.5) --- updated-dependencies: - dependency-name: minimatch dependency-version: 3.1.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Re-trigger automerge workflow after fixing allow_auto_merge + DEPENDABOT_AUTOMERGE_TOKEN --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ronald Landheer-Cieslak <rlc@vlinder.ca>
GitHub treats pull_request-triggered runs whose actor is dependabot[bot] exactly like fork PRs: read-only GITHUB_TOKEN, no access to repo secrets at all. DEPENDABOT_AUTOMERGE_TOKEN was silently resolving to empty every time Dependabot itself triggered the workflow. pull_request_target runs in the base-repo context instead, so secrets are available; this workflow doesn't check out PR code, so there's no added risk.
Replaces the hand-written backport in #11 with a verbatim copy of the now-canonical template in vln-devsecops/guidance (PR #10), which fixes two failure modes the node-dashboard version #11 was based on still had: - self-exclusion now keys on the workflow run id rather than the job name. This job's own check run lands on the same head SHA, so the name filter stops excluding it the moment the job is renamed, and the gate waits on itself until it times out - blocking the PR permanently. - a 180s settle window replaces the 25s sleep. An empty check-run list is indistinguishable from a sibling runner that is still queueing, so concluding "nothing to wait for" early merges before a failing check ever registers - the original node-dashboard#37 bug, reachable again. Verified with guidance's tests/automerge_gate_test.sh against this repo's copy: 10/10 pass. The `ready_for_review` trigger type is dropped to stay byte-identical to the template; Dependabot does not open draft PRs, so it never fired. Refs #10 Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
#14 landed just before guidance#11, which corrected the token comment and added the GITHUB_TOKEN fallback. No behavioural change for this repo - DEPENDABOT_AUTOMERGE_TOKEN is provisioned here, so the PAT branch of the fallback is taken either way - but the runbook requires this file to stay byte-identical to guidance@main. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>