Skip to content

Commit 0c9e6bf

Browse files
committed
refactor: replace @actions/io w/ Node.js built-in fs method
1 parent 2da0ba2 commit 0c9e6bf

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

package-lock.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@
5050
"@actions/core": "^1.10.0",
5151
"@actions/exec": "^1.1.1",
5252
"@actions/github": "^5.1.1",
53-
"@actions/glob": "^0.4.0",
54-
"@actions/io": "^1.1.2"
53+
"@actions/glob": "^0.4.0"
5554
},
5655
"devDependencies": {
5756
"@types/jest": "^29.2.6",

src/set-tokens.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as core from '@actions/core';
22
import * as exec from '@actions/exec';
33
import * as github from '@actions/github';
4-
import * as io from '@actions/io';
54
import path from 'path';
65
import fs from 'fs';
76
// eslint-disable-next-line @typescript-eslint/no-var-requires
@@ -17,7 +16,7 @@ export async function setSSHKey(inps: Inputs, publishRepo: string): Promise<stri
1716

1817
const homeDir = await getHomeDir();
1918
const sshDir = path.join(homeDir, '.ssh');
20-
await io.mkdirP(sshDir);
19+
await fs.promises.mkdir(sshDir, {recursive: true});
2120
await exec.exec('chmod', ['700', sshDir]);
2221

2322
const knownHosts = path.join(sshDir, 'known_hosts');

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export async function getWorkDirName(unixTime: string): Promise<string> {
2424
}
2525

2626
export async function createDir(dirPath: string): Promise<void> {
27-
await io.mkdirP(dirPath);
27+
await fs.promises.mkdir(dirPath, {recursive: true});
2828
core.debug(`Created directory ${dirPath}`);
2929
return;
3030
}

0 commit comments

Comments
 (0)