mirror of
https://github.com/actions/create-release.git
synced 2025-06-15 05:17:44 +00:00
Fix ESLint errors
This commit is contained in:
parent
961e428264
commit
74488db0a3
23
dist/index.js
vendored
23
dist/index.js
vendored
@ -392,13 +392,13 @@ async function run() {
|
|||||||
const { owner, repo } = context.repo;
|
const { owner, repo } = context.repo;
|
||||||
|
|
||||||
// Get the inputs from the workflow file: https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputs
|
// Get the inputs from the workflow file: https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputs
|
||||||
const tag_name = core.getInput('tag_name', { required: true });
|
const tagName = core.getInput('tag_name', { required: true });
|
||||||
// This removes the 'refs/tags' portion of the string, i.e. from 'refs/tags/v1.10.15' to 'v1.10.15'
|
// This removes the 'refs/tags' portion of the string, i.e. from 'refs/tags/v1.10.15' to 'v1.10.15'
|
||||||
const tag = tag_name.replace('refs/tags/', '');
|
const tag = tagName.replace('refs/tags/', '');
|
||||||
// This removes the 'refs/tags' portion of the string, i.e. from 'refs/tags/v1.10.15' to 'v1.10.15'
|
// This removes the 'refs/tags' portion of the string, i.e. from 'refs/tags/v1.10.15' to 'v1.10.15'
|
||||||
const release_name = core.getInput('release_name', { required: true }).replace('refs/tags/', '');
|
const releaseName = core.getInput('release_name', { required: true }).replace('refs/tags/', '');
|
||||||
const draft = core.getInput('draft', { required: false }) === 'true' ? true : false;
|
const draft = core.getInput('draft', { required: false }) === 'true';
|
||||||
const prerelease = core.getInput('prerelease', { required: false }) === 'true' ? true : false;
|
const prerelease = core.getInput('prerelease', { required: false }) === 'true';
|
||||||
|
|
||||||
// Create a release
|
// Create a release
|
||||||
// API Documentation: https://developer.github.com/v3/repos/releases/#create-a-release
|
// API Documentation: https://developer.github.com/v3/repos/releases/#create-a-release
|
||||||
@ -407,19 +407,20 @@ async function run() {
|
|||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
tag_name: tag,
|
tag_name: tag,
|
||||||
name: release_name,
|
name: releaseName,
|
||||||
draft,
|
draft,
|
||||||
prerelease
|
prerelease
|
||||||
});
|
});
|
||||||
|
|
||||||
// Get the ID, html_url, and upload URL for the created Release from the response
|
// Get the ID, html_url, and upload URL for the created Release from the response
|
||||||
const { data: { id: release_id, html_url, upload_url } } = createReleaseResponse;
|
const {
|
||||||
|
data: { id: releaseId, html_url: htmlUrl, upload_url: uploadUrl }
|
||||||
|
} = createReleaseResponse;
|
||||||
|
|
||||||
// Set the output variables for use by other actions: https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputs
|
// Set the output variables for use by other actions: https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputs
|
||||||
core.setOutput('id', release_id);
|
core.setOutput('id', releaseId);
|
||||||
core.setOutput('html_url', html_url);
|
core.setOutput('html_url', htmlUrl);
|
||||||
core.setOutput('upload_url', upload_url);
|
core.setOutput('upload_url', uploadUrl);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
|
23
src/main.js
23
src/main.js
@ -10,13 +10,13 @@ async function run() {
|
|||||||
const { owner, repo } = context.repo;
|
const { owner, repo } = context.repo;
|
||||||
|
|
||||||
// Get the inputs from the workflow file: https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputs
|
// Get the inputs from the workflow file: https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputs
|
||||||
const tag_name = core.getInput('tag_name', { required: true });
|
const tagName = core.getInput('tag_name', { required: true });
|
||||||
// This removes the 'refs/tags' portion of the string, i.e. from 'refs/tags/v1.10.15' to 'v1.10.15'
|
// This removes the 'refs/tags' portion of the string, i.e. from 'refs/tags/v1.10.15' to 'v1.10.15'
|
||||||
const tag = tag_name.replace('refs/tags/', '');
|
const tag = tagName.replace('refs/tags/', '');
|
||||||
// This removes the 'refs/tags' portion of the string, i.e. from 'refs/tags/v1.10.15' to 'v1.10.15'
|
// This removes the 'refs/tags' portion of the string, i.e. from 'refs/tags/v1.10.15' to 'v1.10.15'
|
||||||
const release_name = core.getInput('release_name', { required: true }).replace('refs/tags/', '');
|
const releaseName = core.getInput('release_name', { required: true }).replace('refs/tags/', '');
|
||||||
const draft = core.getInput('draft', { required: false }) === 'true' ? true : false;
|
const draft = core.getInput('draft', { required: false }) === 'true';
|
||||||
const prerelease = core.getInput('prerelease', { required: false }) === 'true' ? true : false;
|
const prerelease = core.getInput('prerelease', { required: false }) === 'true';
|
||||||
|
|
||||||
// Create a release
|
// Create a release
|
||||||
// API Documentation: https://developer.github.com/v3/repos/releases/#create-a-release
|
// API Documentation: https://developer.github.com/v3/repos/releases/#create-a-release
|
||||||
@ -25,19 +25,20 @@ async function run() {
|
|||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
tag_name: tag,
|
tag_name: tag,
|
||||||
name: release_name,
|
name: releaseName,
|
||||||
draft,
|
draft,
|
||||||
prerelease
|
prerelease
|
||||||
});
|
});
|
||||||
|
|
||||||
// Get the ID, html_url, and upload URL for the created Release from the response
|
// Get the ID, html_url, and upload URL for the created Release from the response
|
||||||
const { data: { id: release_id, html_url, upload_url } } = createReleaseResponse;
|
const {
|
||||||
|
data: { id: releaseId, html_url: htmlUrl, upload_url: uploadUrl }
|
||||||
|
} = createReleaseResponse;
|
||||||
|
|
||||||
// Set the output variables for use by other actions: https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputs
|
// Set the output variables for use by other actions: https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputs
|
||||||
core.setOutput('id', release_id);
|
core.setOutput('id', releaseId);
|
||||||
core.setOutput('html_url', html_url);
|
core.setOutput('html_url', htmlUrl);
|
||||||
core.setOutput('upload_url', upload_url);
|
core.setOutput('upload_url', uploadUrl);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user