mirror of
https://github.com/actions/create-release.git
synced 2025-06-14 12:57:43 +00:00
add new input, error if file not found
This commit is contained in:
parent
cf2e5a0ea5
commit
15708f2a34
7
dist/index.js
vendored
7
dist/index.js
vendored
@ -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';
|
||||
|
@ -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';
|
||||
|
Loading…
x
Reference in New Issue
Block a user