From 2a02a573edd60c48701484eadf89b5345685ca9b Mon Sep 17 00:00:00 2001 From: SukkaW Date: Tue, 12 Mar 2024 17:30:36 +0800 Subject: [PATCH] refactor: replace `@actions/io` w/ Node.js built-in fs method --- package-lock.json | 3 +-- package.json | 3 +-- src/set-tokens.ts | 3 +-- src/utils.ts | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index d79ad2a5e..5bebb062e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,8 +13,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", diff --git a/package.json b/package.json index fc98dfc5c..ddb883f58 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/set-tokens.ts b/src/set-tokens.ts index 793970367..8fbf9472a 100644 --- a/src/set-tokens.ts +++ b/src/set-tokens.ts @@ -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 @@ -17,7 +16,7 @@ export async function setSSHKey(inps: Inputs, publishRepo: string): Promise { } export async function createDir(dirPath: string): Promise { - await io.mkdirP(dirPath); + await fs.promises.mkdir(dirPath, {recursive: true}); core.debug(`Created directory ${dirPath}`); return; }