Skip to content

Commit 5f4b562

Browse files
committed
Resolve file path before saving
1 parent b751d52 commit 5f4b562

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as core from '@actions/core'
22
import * as fs from 'fs'
3+
import * as path from 'path'
34

45
async function run(): Promise<void> {
56
try {
@@ -9,7 +10,8 @@ async function run(): Promise<void> {
910
core.info(`Found filename: ${fileName}`)
1011
core.info(`Found json: ${json}`)
1112

12-
fs.writeFileSync(fileName, json)
13+
const filePath = path.resolve(fileName)
14+
fs.writeFileSync(filePath, json)
1315
core.info(`File written successfully`)
1416
} catch (error) {
1517
if (error instanceof Error) core.setFailed(error.message)

0 commit comments

Comments
 (0)