-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
- upgraded node to 16 so that String.replaceAll is supported - added description of replaceAll input into readme and action.yml - updaged @actions/core, removed @actions/github - changed way output is set because core.setOutput is deprecated
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
12 | ||
16 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
const core = require('@actions/core') | ||
const github = require('@actions/github') | ||
const fs = require('fs') | ||
|
||
try { | ||
const source = core.getInput('source') | ||
const find = core.getInput('find') | ||
const replace = core.getInput('replace') | ||
const replaceAllInput = core.getInput('replaceAll') | ||
const replaceAll = replaceAllInput ? replaceAllInput == 'true' : false | ||
const branchName = replaceAll ? source.replaceAll(find, replace) : source.replace(find, replace) | ||
core.setOutput('value', branchName) | ||
const resultValue = replaceAll ? source.replaceAll(find, replace) : source.replace(find, replace) | ||
fs.writeFileSync(process.env.GITHUB_OUTPUT, `value=${resultValue}\n`) | ||
} catch (error) { | ||
core.setFailed(error.message) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.