Skip to content
Closed
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7bdbc08
Update Node.js version and enhance workflow configuration (#1)
blytkerchan Mar 16, 2026
c544b75
Add @vercel/ncc for build process and update package scripts
blytkerchan Mar 16, 2026
138b1c7
fix: check out code before use
blytkerchan Mar 18, 2026
43aac1e
Add Dependabot auto-merge workflow
Copilot Apr 25, 2026
4e77739
Fix npm audit workflow failures
Copilot Apr 26, 2026
b1ce912
Update Node24-compatible workflow actions
blytkerchan Apr 26, 2026
bce4ea0
Update migrated action README references
blytkerchan Apr 28, 2026
38ff9a8
Add unit tests for action logic
blytkerchan Apr 28, 2026
b42d2ea
Fix PowerShell unit test glob
blytkerchan Apr 28, 2026
3acebef
Run unit tests with bash on Windows
blytkerchan Apr 28, 2026
adcf358
List unit test files explicitly
blytkerchan Apr 28, 2026
9903b5d
docs: align README action name
blytkerchan Apr 28, 2026
5b37bbd
ci: fix windows-2025 runner jobs failing on VS 2022 lookup
Copilot Jun 18, 2026
f6566b7
chore: install release-please (#4)
blytkerchan Jul 9, 2026
e4e0d65
Bump js-yaml from 3.13.1 to 3.15.0 (#5)
dependabot[bot] Jul 9, 2026
3e7627e
Bump flatted from 3.2.2 to 3.4.2 (#7)
dependabot[bot] Jul 9, 2026
6eb3836
Use DEPENDABOT_AUTOMERGE_TOKEN in dependabot automerge workflow
blytkerchan Jul 10, 2026
e2115e4
Bump minimatch from 3.1.2 to 3.1.5 (#6)
dependabot[bot] Jul 10, 2026
cb94b1b
Fix automerge: use pull_request_target instead of pull_request
blytkerchan Jul 10, 2026
22bcab4
Migrate ESLint config to flat config and bump to v10 (#9)
blytkerchan Jul 29, 2026
da94470
fix: stop dependabot automerge from merging past failing sibling chec…
blytkerchan Aug 2, 2026
49e26c7
docs: note branch-protection/matrix coupling in main.yml (#12)
blytkerchan Aug 2, 2026
4c2ebad
fix: adopt canonical hardened automerge template from guidance (#14)
blytkerchan Aug 2, 2026
d382dc9
chore: resync automerge workflow with guidance canonical template (#15)
blytkerchan Aug 2, 2026
6adb8f7
chore: resync automerge workflow with canonical template (#16)
blytkerchan Aug 3, 2026
b40c1fb
fix: resync automerge workflow with canonical template (guidance#15) …
blytkerchan Aug 5, 2026
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
27 changes: 27 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
target-branch: dev
schedule:
interval: weekly
day: monday
labels:
- dependencies
- npm
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]

- package-ecosystem: github-actions
directory: /
target-branch: dev
schedule:
interval: weekly
day: monday
labels:
- dependencies
- github-actions
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
32 changes: 32 additions & 0 deletions .github/workflows/ci_dependabot_automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: ci_dependabot_automerge

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: write
pull-requests: write

jobs:
automerge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Fetch Dependabot metadata
id: meta
uses: dependabot/fetch-metadata@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Approve and enable auto-merge for minor and patch updates
if: >-
steps.meta.outputs.update-type == 'version-update:semver-minor' ||
steps.meta.outputs.update-type == 'version-update:semver-patch'
run: |
gh pr review --approve "$PR_URL"
gh pr merge --auto --squash "$PR_URL"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
55 changes: 42 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,40 @@ on:
push:
branches:
- master
- dev
- main
- release/*
schedule:
- cron: '0 6 * * *'

jobs:
test:
name: default
runs-on: windows-latest
name: default (${{ matrix.runner }}, VS ${{ matrix.vsversion }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- runner: windows-2022
vsversion: "2022"
supports_arm32: true
- runner: windows-2025
vsversion: "2026"
supports_arm32: false
steps:
- name: Check out source code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Download Internet
run: npm install
Comment on lines 41 to 42
- name: Run eslint
run: npm run lint
- name: Run unit tests
run: npm test
- name: Enable Developer Command Prompt (amd64)
uses: ./
with:
arch: amd64
vsversion: ${{ matrix.vsversion }}
- name: Compile and run some C code (amd64)
shell: cmd
run: |
Expand All @@ -33,50 +48,64 @@ jobs:
uses: ./
with:
arch: amd64_x86
vsversion: ${{ matrix.vsversion }}
- name: Compile and run some C code (x86)
shell: cmd
run: |
cl.exe hello.c
hello.exe
- name: Enable Developer Command Prompt (amd64_arm)
if: matrix.supports_arm32
uses: ./
with:
arch: amd64_arm
vsversion: ${{ matrix.vsversion }}
- name: Compile some C code (arm)
if: matrix.supports_arm32
shell: cmd
run: |
cl.exe hello.c
dumpbin /headers hello.exe
cl.exe /c hello.c
dumpbin /headers hello.obj
- name: Enable Developer Command Prompt (amd64_arm64)
uses: ./
with:
arch: amd64_arm64
vsversion: ${{ matrix.vsversion }}
- name: Compile some C code (arm64)
shell: cmd
run: |
cl.exe hello.c
dumpbin /headers hello.exe
cl.exe /c hello.c
dumpbin /headers hello.obj
audit:
name: npm audit
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
- run: npm install
- run: npm audit --audit-level=moderate --production
uses: actions/checkout@v6
- run: npm ci
- run: npm audit --audit-level=moderate --omit=dev
- run: npm audit --audit-level=critical
alias-arch:
name: arch aliases
runs-on: windows-latest
name: arch aliases (${{ matrix.runner }}, VS ${{ matrix.vsversion }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- runner: windows-2022
vsversion: "2022"
- runner: windows-2025
vsversion: "2026"
steps:
- name: Check out source code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Download Internet
run: npm install
Comment on lines 112 to 113
- name: Enable Developer Command Prompt
uses: ./
with:
arch: Win32
vsversion: ${{ matrix.vsversion }}
- name: Compile and run some C code
shell: cmd
run: |
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: release-please

on:
push:
branches:
- dev

concurrency:
group: release-please-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: write
pull-requests: write
issues: write

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release

move-major-tag:
name: Move floating major/minor tags
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Move tags to point at the new release
env:
TAG: ${{ needs.release-please.outputs.tag_name }}
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com

MAJOR="${TAG%%.*}"
MINOR="${TAG%.*}"

git tag -fa "$MAJOR" -m "Release $TAG" "${TAG}^{}"
git tag -fa "$MINOR" -m "Release $TAG" "${TAG}^{}"

git push origin "refs/tags/$MAJOR" "refs/tags/$MINOR" --force
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
name: release
runs-on: windows-latest
steps:
- name: Setup Developer Command Prompt
uses: ilammy/msvc-dev-cmd@release/v1
- name: Check out source code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Setup Developer Command Prompt
uses: ./
- name: Compile and run some C code
shell: cmd
run: |
Expand All @@ -26,6 +26,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
- run: npm audit --audit-level=moderate --production
uses: actions/checkout@v6
- run: npm ci
- run: npm audit --audit-level=moderate --omit=dev
- run: npm audit --audit-level=critical
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.0.2"
}
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<a href="https://github.com/ilammy/msvc-dev-cmd"><img alt="GitHub Actions status" src="https://github.com/ilammy/msvc-dev-cmd/workflows/msvc-dev-cmd/badge.svg"></a>
<a href="https://github.com/vln-devsecops/actions-msvc"><img alt="GitHub Actions status" src="https://github.com/vln-devsecops/actions-msvc/workflows/msvc-dev-cmd/badge.svg"></a>

# msvc-dev-cmd
# actions-msvc

[GitHub Action](https://github.com/features/actions) for configuring Developer Command Prompt for Microsoft Visual C++.

This repository publishes the action as `vln-devsecops/actions-msvc`, while continuing the upstream `ilammy/msvc-dev-cmd` work.

This sets up the environment for compiling C/C++ code from command line.

Supports Windows. Does nothing on Linux and macOS.
Expand All @@ -16,8 +18,8 @@ Basic usage for default compilation settings is like this:
jobs:
test:
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- uses: actions/checkout@v5
- uses: vln-devsecops/actions-msvc@v1
Comment on lines +21 to +22
- name: Build something requiring CL.EXE
run: |
cmake -G "NMake Makefiles" .
Expand All @@ -41,8 +43,8 @@ jobs:
- amd64_x86
- amd64_arm64
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- uses: actions/checkout@v5
- uses: vln-devsecops/actions-msvc@v1
Comment on lines +46 to +47
with:
arch: ${{ matrix.arch }}
- name: Build something requiring CL.EXE
Expand Down Expand Up @@ -80,7 +82,7 @@ Using `shell: bash` in Actions may shadow some of the paths added by MSVC.
In particular, `link.exe` (Microsoft C linker) is prone to be shadowed by `/usr/bin/link` (GNU filesystem link tool).

Unfortunately, this happens because GitHub Actions unconditionally *prepend* GNU paths when `shell: bash` is used,
on top of any paths set by `msvc-dev-cmd`, every time at the start of each new step.
on top of any paths set by `vln-devsecops/actions-msvc`, every time at the start of each new step.
Hence, there aren't many non-destructive options here.

If you experience compilation errors where `link` complains about unreasonable command-line arguments,
Expand All @@ -90,7 +92,7 @@ If this is not acceptable, please file an issue, then we'll figure out something

### Reconfiguration

You can invoke `ilammy/msvc-dev-cmd` multiple times during your jobs with different inputs
You can invoke `vln-devsecops/actions-msvc` multiple times during your jobs with different inputs
to reconfigure the environment for building with different settings
(e.g., to target multiple architectures).

Expand All @@ -100,21 +102,21 @@ jobs:
steps:
# ...
- name: Configure build for amd64
uses: ilammy/msvc-dev-cmd@v1
uses: vln-devsecops/actions-msvc@v1
with:
arch: amd64

- run: build # (for amd64)

- name: Configure build for x86
uses: ilammy/msvc-dev-cmd@v1
uses: vln-devsecops/actions-msvc@v1
with:
arch: amd64_x86

- run: build # (for x86)

- name: Configure build for ARM64
uses: ilammy/msvc-dev-cmd@v1
uses: vln-devsecops/actions-msvc@v1
with:
arch: amd64_arm64

Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ inputs:
sdk:
description: Windows SDK number to build for
spectre:
description: Enable Specre mitigations
description: Enable Spectre mitigations
toolset:
description: VC++ compiler toolset version
uwp:
description: Build for Universal Windows Platform
vsversion:
description: The Visual Studio version to use. This can be the version number (e.g. 16.0 for 2019) or the year (e.g. "2019").
runs:
using: node20
main: index.js
using: node24
main: dist/index.js
branding:
icon: terminal
color: purple
1 change: 1 addition & 0 deletions dist/index.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const EDITIONS = ['Enterprise', 'Professional', 'Community', 'BuildTools']
const YEARS = ['2022', '2019', '2017']

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
const YEARS = ['2022', '2019', '2017']
const YEARS = ['2026', '2022', '2019', '2017']

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi, @blytkerchan, this one?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.


const VsYearVersion = {
'2026': '18.0',
'2022': '17.0',
'2019': '16.0',
'2017': '15.0',
Expand Down Expand Up @@ -112,7 +113,7 @@ function isPathVariable(name) {

function filterPathValue(path) {
let paths = path.split(';')
// Remove duplicates by keeping the first occurance and preserving order.
// Remove duplicates by keeping the first occurrence and preserving order.
// This keeps path shadowing working as intended.
function unique(value, index, self) {
return self.indexOf(value) === index
Expand Down
Loading