From 3563849c8a218168f77aa25e73649edd5ccae5f8 Mon Sep 17 00:00:00 2001 From: Peter Evans <18365890+peter-evans@users.noreply.github.com> Date: Fri, 26 Jul 2024 12:41:31 +0000 Subject: [PATCH] read to buffer not string and use non-legacy method to base64 --- dist/index.js | 2 +- src/create-pull-request.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index b5f7a95..db50522 100644 --- a/dist/index.js +++ b/dist/index.js @@ -525,7 +525,7 @@ function createPullRequest(inputs) { core.debug(`Reading contents of file: '${file}'`); fileChanges.additions.push({ path: file, - contents: btoa(fs.readFileSync(file, 'utf8')) + contents: fs.readFileSync(file).toString('base64') }); } for (const file of deletedFiles) { diff --git a/src/create-pull-request.ts b/src/create-pull-request.ts index 1cad292..041e2ba 100644 --- a/src/create-pull-request.ts +++ b/src/create-pull-request.ts @@ -327,7 +327,7 @@ export async function createPullRequest(inputs: Inputs): Promise { core.debug(`Reading contents of file: '${file}'`) fileChanges.additions!.push({ path: file, - contents: btoa(fs.readFileSync(file, 'utf8')) + contents: fs.readFileSync(file).toString('base64') }) }