Files
read-file-action/index.js
Min Huang f041d96fd1 Fixes bug where getBooleanInput is not available (#10)
* Updates core

* Updates core

* Change version

* fix

* run audit fix

* Should be fn call
2021-05-26 12:45:27 +02:00

18 lines
385 B
JavaScript

'use strict'
const core = require('@actions/core')
const { promises: fs } = require('fs')
const main = async () => {
const path = core.getInput('path')
const trim = core.getBooleanInput('trim')
let content = await fs.readFile(path, 'utf8')
if (trim) {
content = content.trim()
}
core.setOutput('content', content)
}
main().catch(err => core.setFailed(err.message))