Skip to content

Commit 28f2855

Browse files
authored
Fix types, and update node version. (#181)
* Fix types, and update node version. Signed-off-by: Tatsat Mishra <tamishra@microsoft.com> * Prettier Fix for this repo. Signed-off-by: Tatsat Mishra <tamishra@microsoft.com> --------- Signed-off-by: Tatsat Mishra <tamishra@microsoft.com>
1 parent d030d7f commit 28f2855

File tree

5 files changed

+41
-38
lines changed

5 files changed

+41
-38
lines changed

.github/workflows/prettify-code.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,4 @@ jobs:
1313
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1414

1515
- name: Enforce Prettier
16-
uses: actionsx/prettier@3d9f7c3fa44c9cb819e68292a328d7f4384be206 # v3
17-
with:
18-
args: --check .
16+
run: npx prettier --check .

CHANGELOG.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
## [4.3.0] - 2025-02-15
44

5-
- #152 feat: log when restoring from cache
6-
- #157 Dependencies Update
7-
- #137 Add dependabot
5+
- #152 feat: log when restoring from cache
6+
- #157 Dependencies Update
7+
- #137 Add dependabot
88

99
## [4.2.0] - 2024-04-15
1010

11-
- #124 Fix OS detection and download OS-native archive extension
11+
- #124 Fix OS detection and download OS-native archive extension
1212

1313
## [4.1.0] - 2024-03-01
1414

15-
- #130 switches to use Helm published file to read latest version instead of using GitHub releases
15+
- #130 switches to use Helm published file to read latest version instead of using GitHub releases
1616

1717
## [4.0.0] - 2024-02-12
1818

19-
- #121 update to node20 as node16 is deprecated
19+
- #121 update to node20 as node16 is deprecated

CODE_OF_CONDUCT.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
44

55
Resources:
66

7-
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8-
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9-
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
7+
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8+
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9+
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns

SECURITY.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ You should receive a response within 24 hours. If for some reason you do not, pl
1818

1919
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
2020

21-
- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22-
- Full paths of source file(s) related to the manifestation of the issue
23-
- The location of the affected source code (tag/branch/commit or direct URL)
24-
- Any special configuration required to reproduce the issue
25-
- Step-by-step instructions to reproduce the issue
26-
- Proof-of-concept or exploit code (if possible)
27-
- Impact of the issue, including how an attacker might exploit the issue
21+
- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22+
- Full paths of source file(s) related to the manifestation of the issue
23+
- The location of the affected source code (tag/branch/commit or direct URL)
24+
- Any special configuration required to reproduce the issue
25+
- Step-by-step instructions to reproduce the issue
26+
- Proof-of-concept or exploit code (if possible)
27+
- Impact of the issue, including how an attacker might exploit the issue
2828

2929
This information will help us triage your report more quickly.
3030

src/run.test.ts

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,20 @@ describe('run.ts', () => {
9999
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => {
100100
if (file == 'mainFolder')
101101
return [
102-
'file1' as unknown as fs.Dirent,
103-
'file2' as unknown as fs.Dirent,
104-
'folder1' as unknown as fs.Dirent,
105-
'folder2' as unknown as fs.Dirent
102+
'file1' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
103+
'file2' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
104+
'folder1' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
105+
'folder2' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
106106
]
107107
if (file == path.join('mainFolder', 'folder1'))
108108
return [
109-
'file11' as unknown as fs.Dirent,
110-
'file12' as unknown as fs.Dirent
109+
'file11' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
110+
'file12' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
111111
]
112112
if (file == path.join('mainFolder', 'folder2'))
113113
return [
114-
'file21' as unknown as fs.Dirent,
115-
'file22' as unknown as fs.Dirent
114+
'file21' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
115+
'file22' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
116116
]
117117
return []
118118
})
@@ -134,20 +134,20 @@ describe('run.ts', () => {
134134
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => {
135135
if (file == 'mainFolder')
136136
return [
137-
'file1' as unknown as fs.Dirent,
138-
'file2' as unknown as fs.Dirent,
139-
'folder1' as unknown as fs.Dirent,
140-
'folder2' as unknown as fs.Dirent
137+
'file1' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
138+
'file2' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
139+
'folder1' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
140+
'folder2' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
141141
]
142142
if (file == path.join('mainFolder', 'folder1'))
143143
return [
144-
'file11' as unknown as fs.Dirent,
145-
'file12' as unknown as fs.Dirent
144+
'file11' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
145+
'file12' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
146146
]
147147
if (file == path.join('mainFolder', 'folder2'))
148148
return [
149-
'file21' as unknown as fs.Dirent,
150-
'file22' as unknown as fs.Dirent
149+
'file21' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
150+
'file22' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
151151
]
152152
return []
153153
})
@@ -166,7 +166,8 @@ describe('run.ts', () => {
166166
test('findHelm() - change access permissions and find the helm in given directory', () => {
167167
jest.spyOn(fs, 'chmodSync').mockImplementation(() => {})
168168
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => {
169-
if (file == 'mainFolder') return ['helm.exe' as unknown as fs.Dirent]
169+
if (file == 'mainFolder')
170+
return ['helm.exe' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>]
170171
return []
171172
})
172173
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
@@ -208,7 +209,9 @@ describe('run.ts', () => {
208209
jest.spyOn(toolCache, 'cacheDir').mockResolvedValue('pathToCachedDir')
209210
jest
210211
.spyOn(fs, 'readdirSync')
211-
.mockImplementation((file, _) => ['helm.exe' as unknown as fs.Dirent])
212+
.mockImplementation((file, _) => [
213+
'helm.exe' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
214+
])
212215
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
213216
const isDirectory =
214217
(file as string).indexOf('folder') == -1 ? false : true
@@ -254,7 +257,9 @@ describe('run.ts', () => {
254257
jest.spyOn(fs, 'chmodSync').mockImplementation(() => {})
255258
jest
256259
.spyOn(fs, 'readdirSync')
257-
.mockReturnValue(['helm.exe' as unknown as fs.Dirent])
260+
.mockReturnValue([
261+
'helm.exe' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
262+
])
258263
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
259264
const isDirectory =
260265
(file as string).indexOf('folder') == -1 ? false : true

0 commit comments

Comments
 (0)