Skip to content

Commit f3e3c10

Browse files
authored
Revert "feat: using env.runner_temp instead of home directory to write json f…" (#76)
This reverts commit 7296f08.
1 parent 4c1d1d7 commit f3e3c10

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Use this action to convert issues into a unified JSON structure. Read the [Codel
1212
with:
1313
template-path: .github/ISSUE_TEMPLATE/bug-report.yml # optional but recommended
1414

15-
- run: cat ${{ runner.temp }}/issue-parser-result.json
15+
- run: cat ${HOME}/issue-parser-result.json
1616

1717
- run: echo $FAVORITE_DISH
1818
env:

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ async function run(env, body, fs, core) {
165165
}
166166

167167
fs.writeFileSync(
168-
`${env.RUNNER_TEMP}/issue-parser-result.json`,
168+
`${env.USERPROFILE || env.HOME}/issue-parser-result.json`,
169169
jsonStringify(result),
170170
"utf-8"
171171
);

test.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ it("readme example", () => {
1313

1414
// mock ENV
1515
const env = {
16-
RUNNER_TEMP: "<runner_temp path>",
16+
HOME: "<home path>",
1717
};
1818

1919
// mock event payload
@@ -27,7 +27,7 @@ it("readme example", () => {
2727
return readFileSync("fixtures/readme-example/form.yml", "utf-8");
2828
},
2929
writeFileSync(path, content) {
30-
expect(path).toBe("<runner_temp path>/issue-parser-result.json");
30+
expect(path).toBe("<home path>/issue-parser-result.json");
3131
expect(content).toBe(expectedOutputJson);
3232
},
3333
};
@@ -52,7 +52,7 @@ it("full example", () => {
5252

5353
// mock ENV
5454
const env = {
55-
RUNNER_TEMP: "<runner_temp path>",
55+
HOME: "<home path>",
5656
};
5757

5858
// mock event payload
@@ -66,7 +66,7 @@ it("full example", () => {
6666
return readFileSync("fixtures/full-example/form.yml", "utf-8");
6767
},
6868
writeFileSync(path, content) {
69-
expect(path).toBe("<runner_temp path>/issue-parser-result.json");
69+
expect(path).toBe("<home path>/issue-parser-result.json");
7070
expect(content).toBe(expectedOutputJson);
7171
},
7272
};
@@ -140,7 +140,7 @@ it("multiple paragraphs", () => {
140140

141141
// mock ENV
142142
const env = {
143-
RUNNER_TEMP: "<runner_temp path>",
143+
HOME: "<home path>",
144144
};
145145

146146
// mock event payload
@@ -154,7 +154,7 @@ it("multiple paragraphs", () => {
154154
return readFileSync("fixtures/multiple-paragraphs/form.yml", "utf-8");
155155
},
156156
writeFileSync(path, content) {
157-
expect(path).toBe("<runner_temp path>/issue-parser-result.json");
157+
expect(path).toBe("<home path>/issue-parser-result.json");
158158
expect(content).toBe(expectedOutputJson);
159159
},
160160
};
@@ -180,7 +180,7 @@ it("blank", () => {
180180

181181
// mock ENV
182182
const env = {
183-
RUNNER_TEMP: "<runner_temp path>",
183+
HOME: "<home path>",
184184
};
185185

186186
// mock event payload
@@ -194,7 +194,7 @@ it("blank", () => {
194194
return readFileSync("fixtures/blank/form.yml", "utf-8");
195195
},
196196
writeFileSync(path, content) {
197-
expect(path).toBe("<runner_temp path>/issue-parser-result.json");
197+
expect(path).toBe("<home path>/issue-parser-result.json");
198198
expect(content).toBe(expectedOutputJson);
199199
},
200200
};

0 commit comments

Comments
 (0)