Fix ESLint errors

This commit is contained in:
Thomas Hughes 2019-09-20 15:11:35 -05:00
parent 961e428264
commit 74488db0a3
No known key found for this signature in database
GPG Key ID: B2D8646423EF5814
2 changed files with 24 additions and 22 deletions

23
dist/index.js vendored
View File

@ -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);
} }

View File

@ -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);
} }