From 7b01f29c8d763c7993245c2a19a93db60c27be0a Mon Sep 17 00:00:00 2001 From: Josh Johanning Date: Fri, 16 Jun 2023 15:58:10 -0500 Subject: [PATCH 1/4] writing json to runner_temp --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 5af14eb..50a840e 100644 --- a/index.js +++ b/index.js @@ -162,7 +162,7 @@ async function run(env, body, fs, core) { } fs.writeFileSync( - `${env.USERPROFILE || env.HOME}/issue-parser-result.json`, + `${env.RUNNER_TEMP}/issue-parser-result.json`, jsonStringify(result), "utf-8" ); From 3be98d8236a496713411bf7c4f94b0476705ed00 Mon Sep 17 00:00:00 2001 From: Josh Johanning Date: Tue, 28 May 2024 18:14:35 -0500 Subject: [PATCH 2/4] test: update mocks to reflect change to runner temp directory --- test.spec.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test.spec.js b/test.spec.js index adbd4ec..26fdcbc 100644 --- a/test.spec.js +++ b/test.spec.js @@ -13,7 +13,7 @@ it("readme example", () => { // mock ENV const env = { - HOME: "", + RUNNER_TEMP: "", }; // 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 = { - HOME: "", + RUNNER_TEMP: "", }; // 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); }, }; @@ -96,7 +96,7 @@ it("multiple paragraphs", () => { // mock ENV const env = { - HOME: "", + RUNNER_TEMP: "", }; // mock event payload @@ -110,7 +110,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); }, }; @@ -136,7 +136,7 @@ it("blank", () => { // mock ENV const env = { - HOME: "", + RUNNER_TEMP: "", }; // mock event payload @@ -150,7 +150,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); }, }; From bd9aabaa6140a5eae304dafe4dcddbb18c9b1670 Mon Sep 17 00:00:00 2001 From: Josh Johanning Date: Tue, 28 May 2024 19:24:20 -0500 Subject: [PATCH 3/4] docs: update path in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b66853c..236f547 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 ${HOME}/issue-parser-result.json +- run: cat ${{ runner.temp }}/issue-parser-result.json - run: echo $FAVORITE_DISH env: From bce74d58ab990baf781e586abaff309a27fcbbb8 Mon Sep 17 00:00:00 2001 From: Gregor Martynus <39992+gr2m@users.noreply.github.com> Date: Wed, 29 May 2024 11:35:54 -0700 Subject: [PATCH 4/4] empty message to trigger CI