* Read a GitHub Actions input value, handling both the standard underscore form * (INPUT_ ) and the hyphen form (INPUT_ ) preserved by some runner versions. * * GitHub Actions converts input names to INPUT_ by default, but * some runner versions preserve the original
(name)
| 17 | * @returns {string} Trimmed input value, or "" if not set. |
| 18 | */ |
| 19 | function getActionInput(name) { |
| 20 | const hyphenName = name.replace(/_/g, "-"); |
| 21 | return (process.env[`INPUT_${name}`] || process.env[`INPUT_${hyphenName}`] || "").trim(); |
| 22 | } |
| 23 | |
| 24 | module.exports = { getActionInput }; |
no outgoing calls
no test coverage detected