Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
emibcn committed Dec 9, 2022
1 parent 94cb846 commit bbb2919
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"access": "public"
},
"dependencies": {
"@actions/core": "^1.3.0",
"@actions/core": "^1.10.0",
"gradient-badge": "^1.3.1"
},
"devDependencies": {
Expand Down
12 changes: 6 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,36 @@ const createBadgeFromInputs = ({
{}
)

console.log('Received inputs:', inputs)
core.debug('Received inputs:', inputs)

// Fix some inputs
for (const [key, fn] of Object.entries(inputFixes)) {
inputs[key] = fn(inputs)
}

console.log('Generate badge using the given inputs and defaults:', inputs)
core.info('Generate badge using the given inputs and defaults:', inputs)

// Generate the badge
const { path, ...gradientBadgeOptions } = inputs
const svgString = gradientBadge(gradientBadgeOptions)

// Output badge contents to Action output
if (outputName?.length) {
console.log("Write data to action's output 'badge'...")
core.info("Write data to action's output 'badge'...")
core.setOutput(outputName, svgString)
}

// If path is defined, save SVG data to that file
if (path?.length) {
console.log(`Write data to file ${path}...`)
core.info(`Write data to file ${path}...`)

// In case an error occurred writing file,
// exception is thrown and success messsage is not printed
fs.writeFileSync(path, svgString)
console.log('Data saved succesfully.')
core.info('Data saved succesfully.')
}
} catch (error) {
console.error(error)
core.error(error)
core.setFailed(error.message)
}
}
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# yarn lockfile v1


"@actions/core@^1.3.0":
"@actions/core@^1.10.0":
version "1.10.0"
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.10.0.tgz#44551c3c71163949a2f06e94d9ca2157a0cfac4f"
integrity sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==
Expand Down

0 comments on commit bbb2919

Please sign in to comment.