add new input, error if file not found

This commit is contained in:
Jacob Bolda 2020-02-03 23:04:42 -06:00
parent cf2e5a0ea5
commit 15708f2a34
No known key found for this signature in database
GPG Key ID: 22CE5B1A2BD487F7
2 changed files with 8 additions and 6 deletions

7
dist/index.js vendored
View File

@ -7863,11 +7863,12 @@ async function run() {
const tag = tagName.replace('refs/tags/', '');
const releaseName = core.getInput('release_name', { required: true }).replace('refs/tags/', '');
const body = core.getInput('body', { required: false });
const bodyFromFile = core.getInput('bodyFromFile', { required: false });
let bodyFile = null;
try {
bodyFile = fs.readFileSync(body, { encoding: 'string' });
} catch (e) {
// noop
bodyFile = fs.readFileSync(bodyFromFile, { encoding: 'string' });
} catch (error) {
core.setFailed(error.message);
}
const draft = core.getInput('draft', { required: false }) === 'true';
const prerelease = core.getInput('prerelease', { required: false }) === 'true';

View File

@ -17,11 +17,12 @@ async function run() {
const tag = tagName.replace('refs/tags/', '');
const releaseName = core.getInput('release_name', { required: true }).replace('refs/tags/', '');
const body = core.getInput('body', { required: false });
const bodyFromFile = core.getInput('bodyFromFile', { required: false });
let bodyFile = null;
try {
bodyFile = fs.readFileSync(body, { encoding: 'string' });
} catch (e) {
// noop
bodyFile = fs.readFileSync(bodyFromFile, { encoding: 'string' });
} catch (error) {
core.setFailed(error.message);
}
const draft = core.getInput('draft', { required: false }) === 'true';
const prerelease = core.getInput('prerelease', { required: false }) === 'true';