Skip to content

Commit

Permalink
refactor: replace @actions/io w/ Node.js built-in fs method
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Mar 12, 2024
1 parent 2da0ba2 commit 0c9e6bf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1",
"@actions/github": "^5.1.1",
"@actions/glob": "^0.4.0",
"@actions/io": "^1.1.2"
"@actions/glob": "^0.4.0"
},
"devDependencies": {
"@types/jest": "^29.2.6",
Expand Down
3 changes: 1 addition & 2 deletions src/set-tokens.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as github from '@actions/github';
import * as io from '@actions/io';
import path from 'path';
import fs from 'fs';
// eslint-disable-next-line @typescript-eslint/no-var-requires
Expand All @@ -17,7 +16,7 @@ export async function setSSHKey(inps: Inputs, publishRepo: string): Promise<stri

const homeDir = await getHomeDir();
const sshDir = path.join(homeDir, '.ssh');
await io.mkdirP(sshDir);
await fs.promises.mkdir(sshDir, {recursive: true});
await exec.exec('chmod', ['700', sshDir]);

const knownHosts = path.join(sshDir, 'known_hosts');
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function getWorkDirName(unixTime: string): Promise<string> {
}

export async function createDir(dirPath: string): Promise<void> {
await io.mkdirP(dirPath);
await fs.promises.mkdir(dirPath, {recursive: true});
core.debug(`Created directory ${dirPath}`);
return;
}
Expand Down

0 comments on commit 0c9e6bf

Please sign in to comment.