From 090234a387fd67736da246e089ae1e58a079ebce Mon Sep 17 00:00:00 2001 From: Jan Macku Date: Sat, 1 Jun 2024 06:42:28 +0200 Subject: [PATCH] =?UTF-8?q?Revert=20"feat:=20using=20env.runner=5Ftemp=20i?= =?UTF-8?q?nstead=20of=20home=20directory=20to=20write=20json=20f=E2=80=A6?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7296f0807778ed0f15b3625461fd61179a40e583. --- README.md | 2 +- index.js | 2 +- test.spec.js | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 236f547..b66853c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Use this action to convert issues into a unified JSON structure. Read the [Codel with: template-path: .github/ISSUE_TEMPLATE/bug-report.yml # optional but recommended -- run: cat ${{ runner.temp }}/issue-parser-result.json +- run: cat ${HOME}/issue-parser-result.json - run: echo $FAVORITE_DISH env: diff --git a/index.js b/index.js index d2baea2..53cc884 100644 --- a/index.js +++ b/index.js @@ -165,7 +165,7 @@ async function run(env, body, fs, core) { } fs.writeFileSync( - `${env.RUNNER_TEMP}/issue-parser-result.json`, + `${env.USERPROFILE || env.HOME}/issue-parser-result.json`, jsonStringify(result), "utf-8" ); diff --git a/test.spec.js b/test.spec.js index bfef70e..c3ce9bc 100644 --- a/test.spec.js +++ b/test.spec.js @@ -13,7 +13,7 @@ it("readme example", () => { // mock ENV const env = { - RUNNER_TEMP: "", + HOME: "", }; // mock event payload @@ -27,7 +27,7 @@ it("readme example", () => { return readFileSync("fixtures/readme-example/form.yml", "utf-8"); }, writeFileSync(path, content) { - expect(path).toBe("/issue-parser-result.json"); + expect(path).toBe("/issue-parser-result.json"); expect(content).toBe(expectedOutputJson); }, }; @@ -52,7 +52,7 @@ it("full example", () => { // mock ENV const env = { - RUNNER_TEMP: "", + HOME: "", }; // mock event payload @@ -66,7 +66,7 @@ it("full example", () => { return readFileSync("fixtures/full-example/form.yml", "utf-8"); }, writeFileSync(path, content) { - expect(path).toBe("/issue-parser-result.json"); + expect(path).toBe("/issue-parser-result.json"); expect(content).toBe(expectedOutputJson); }, }; @@ -140,7 +140,7 @@ it("multiple paragraphs", () => { // mock ENV const env = { - RUNNER_TEMP: "", + HOME: "", }; // mock event payload @@ -154,7 +154,7 @@ it("multiple paragraphs", () => { return readFileSync("fixtures/multiple-paragraphs/form.yml", "utf-8"); }, writeFileSync(path, content) { - expect(path).toBe("/issue-parser-result.json"); + expect(path).toBe("/issue-parser-result.json"); expect(content).toBe(expectedOutputJson); }, }; @@ -180,7 +180,7 @@ it("blank", () => { // mock ENV const env = { - RUNNER_TEMP: "", + HOME: "", }; // mock event payload @@ -194,7 +194,7 @@ it("blank", () => { return readFileSync("fixtures/blank/form.yml", "utf-8"); }, writeFileSync(path, content) { - expect(path).toBe("/issue-parser-result.json"); + expect(path).toBe("/issue-parser-result.json"); expect(content).toBe(expectedOutputJson); }, };