Compare commits

..

5 Commits

Author SHA1 Message Date
Suneha Bose 787b48379f update pkg lock 2026-03-26 12:54:02 -07:00
Suneha Bose 16f33d5a55 update pkg lock 2026-03-26 12:42:14 -07:00
Suneha Bose 9d027c90e0 Merge branch 'main' of https://github.com/Azure/k8s-set-context into migrate-to-esm 2026-03-26 12:28:29 -07:00
Suneha Bose 999ddc4def remove build.mjs and update build script 2026-03-25 14:00:31 -07:00
Suneha Bose fc3887264c Migrate to ESM, esbuild, vitest, and update actions/* to latest
- Update @actions/core to 3.x, @actions/exec to 3.x, @actions/io to 3.x
- Replace @vercel/ncc + babel with esbuild (build.mjs) targeting Node 20 ESM
- Replace jest/babel-jest/ts-jest with vitest and @vitest/coverage-v8
- Update tsconfig to NodeNext module resolution with strict mode
- Add explicit .js extensions to all relative imports (NodeNext requirement)
- Fix implicit any index signatures in parseCluster and parseMethod
- Migrate all test files from jest to vi.mock/vi.mocked APIs
- Fix ESM module spying limitations using vi.mock() at module level
- Fix env var test pollution in default.test.ts with afterEach cleanup
2026-03-25 10:54:37 -07:00
12 changed files with 328 additions and 380 deletions
+3 -3
View File
@@ -55,11 +55,11 @@ jobs:
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v3.29.5
uses: github/codeql-action/init@38697555549f1db7851b81482ff19f1fa5c4fedc # v3.29.5
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
@@ -86,6 +86,6 @@ jobs:
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v3.29.5
uses: github/codeql-action/analyze@38697555549f1db7851b81482ff19f1fa5c4fedc # v3.29.5
with:
category: '/language:${{matrix.language}}'
+2 -2
View File
@@ -13,7 +13,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 # v10.3.0
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
name: Setting Issue as Idle
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
@@ -24,7 +24,7 @@ jobs:
operations-per-run: 100
exempt-issue-labels: 'backlog'
- uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 # v10.3.0
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
name: Setting PR as Idle
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
+1 -1
View File
@@ -15,7 +15,7 @@ jobs:
steps:
- name: Checkout Source Code
id: checkout-code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Npm Install and Build
id: npm-build
run: |
+2 -2
View File
@@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 'lts/*'
cache: 'npm'
+1 -1
View File
@@ -13,6 +13,6 @@ jobs:
permissions:
actions: read
contents: write
uses: Azure/action-release-workflows/.github/workflows/release_js_project.yaml@3c677ba5ab58f5c5c1a6f0cfb176b333b1f27405 # v1
uses: Azure/action-release-workflows/.github/workflows/release_js_project.yaml@v1
with:
changelogPath: ./CHANGELOG.md
+10
View File
@@ -0,0 +1,10 @@
name: Tag and create release draft
on:
push:
branches:
- releases/*
jobs:
tag-and-release:
uses: OliverMKing/javascript-release-workflow/.github/workflows/tag-and-release.yml@main
+1 -1
View File
@@ -13,7 +13,7 @@ jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run Unit Tests
run: |
npm install
-39
View File
@@ -1,44 +1,5 @@
# Change Log
## [5.0.0] - 2026-04-07
### Features
- #227 Migrate to ESM with esbuild, vitest
### Runtime and platform
- #222 Update Node version from 20 to 24
### Dependabot updates
- #231 Bump github/codeql-action in /.github/workflows in the actions group
- #230 Bump typescript in the actions group across 1 directory
- #228 Bump picomatch
- #226 Bump github/codeql-action in /.github/workflows in the actions group
- #223 Bump undici from 6.23.0 to 6.24.0
- #221 Bump the actions group in /.github/workflows with 2 updates
- #218 Bump the actions group in /.github/workflows with 2 updates
- #219 Bump minimatch
- #217 Bump undici and @actions/http-client
- #216 Bump github/codeql-action in /.github/workflows in the actions group
- #214 Bump the actions group in /.github/workflows with 2 updates
- #212 Bump the actions group in /.github/workflows with 2 updates
- #211 Bump the actions group with 3 updates
- #210 Bump the actions group with 2 updates
- #208 Bump @types/node from 25.0.2 to 25.0.3 in the actions group
- #209 Bump github/codeql-action in /.github/workflows in the actions group
- #206 Bump the actions group with 3 updates
- #207 Bump github/codeql-action in /.github/workflows in the actions group
- #205 Bump the actions group in /.github/workflows with 4 updates
- #204 Bump the actions group with 2 updates
- #202 Bump the actions group in /.github/workflows with 2 updates
- #203 Bump prettier from 3.6.2 to 3.7.3 in the actions group
- #201 Bump glob from 10.4.5 to 10.5.0
- #200 Bump js-yaml from 3.14.1 to 3.14.2
- #198 Bump js-yaml from 4.1.0 to 4.1.1
- #199 Bump the actions group with 2 updates
## [4.0.2] - 2025-11-13
- #[164](https://github.com/Azure/k8s-set-context/pull/164) Adding optional kubeconfig encoding variable
+4 -4
View File
@@ -19,7 +19,7 @@ Refer to the [action metadata file](./action.yml) for details about inputs. Note
### Kubeconfig approach
```yaml
- uses: azure/k8s-set-context@v5
- uses: azure/k8s-set-context@v4
with:
method: kubeconfig
kubeconfig: <your kubeconfig>
@@ -50,7 +50,7 @@ Please refer to documentation on fetching [kubeconfig for any generic K8s cluste
### Service account approach
```yaml
- uses: azure/k8s-set-context@v5
- uses: azure/k8s-set-context@v4
with:
method: service-account
k8s-url: <URL of the cluster's API server>
@@ -74,7 +74,7 @@ kubectl get secret <service-account-secret-name> -n <namespace> -o yaml
### Service account approach for arc cluster
```yaml
- uses: azure/k8s-set-context@v5
- uses: azure/k8s-set-context@v4
with:
method: service-account
cluster-type: arc
@@ -86,7 +86,7 @@ kubectl get secret <service-account-secret-name> -n <namespace> -o yaml
### Service principal approach for arc cluster
```yaml
- uses: azure/k8s-set-context@v5
- uses: azure/k8s-set-context@v4
with:
method: service-principal
cluster-type: arc
+296 -318
View File
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -1,6 +1,6 @@
{
"name": "k8s-set-context-action",
"version": "5.0.0",
"version": "4.0.2",
"private": true,
"main": "lib/index.js",
"type": "module",
@@ -21,19 +21,19 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/core": "^3.0.1",
"@actions/core": "^3.0.0",
"@actions/exec": "^3.0.0",
"@actions/io": "^3.0.2",
"@kubernetes/client-node": "^1.4.0",
"husky": "^9.1.7",
"js-yaml": "^4.2.0"
"js-yaml": "^4.1.1"
},
"devDependencies": {
"@types/js-yaml": "^4.0.9",
"@types/node": "^25.9.3",
"esbuild": "^0.28.1",
"prettier": "^3.8.4",
"typescript": "^6.0.3",
"vitest": "^4.1.8"
"@types/node": "^25.0.9",
"esbuild": "^0.27.4",
"prettier": "^3.8.0",
"typescript": "^5.9.3",
"vitest": "^4.1.1"
}
}
-1
View File
@@ -36,7 +36,6 @@ export async function runAzKubeconfigCommandBlocking(
proc.unref()
await sleep(AZ_TIMEOUT_SECONDS)
fs.chmodSync(kubeconfigPath, 0o600)
return fs.readFileSync(kubeconfigPath).toString()
}