Merge branch 'master' into master

This commit is contained in:
Mike Coutermarsh 2020-07-01 07:26:37 -07:00 committed by GitHub
commit 8210505c40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 467 additions and 333 deletions

52
.github/workflows/codeql.yml vendored Normal file
View File

@ -0,0 +1,52 @@
name: "Code scanning - action"
on:
push:
pull_request:
schedule:
- cron: '0 19 * * 0'
jobs:
CodeQL-Build:
# CodeQL runs on ubuntu-latest and windows-latest
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

15
.github/workflows/versioning.yml vendored Normal file
View File

@ -0,0 +1,15 @@
name: Keep the versions up-to-date
on:
release:
types: [published]
jobs:
actions-tagger:
runs-on: windows-latest
steps:
- uses: Actions-R-Us/actions-tagger@latest
with:
publish_latest: true
env:
GITHUB_TOKEN: '${{secrets.GITHUB_TOKEN}}'

View File

@ -45,7 +45,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@master uses: actions/checkout@v2
- name: Create Release - name: Create Release
id: create_release id: create_release
uses: actions/create-release@v1 uses: actions/create-release@v1

View File

@ -22,6 +22,9 @@ inputs:
description: '`true` to identify the release as a prerelease. `false` to identify the release as a full release. Default: `false`' description: '`true` to identify the release as a prerelease. `false` to identify the release as a full release. Default: `false`'
required: false required: false
default: false default: false
commitish:
description: 'Any branch or commit SHA the Git tag is created from, unused if the Git tag already exists. Default: SHA of current commit'
required: false
outputs: outputs:
id: id:
description: 'The ID of the created Release' description: 'The ID of the created Release'

512
dist/index.js vendored
View File

@ -1905,50 +1905,50 @@ function getUserAgentNode () {
/***/ (function(__unusedmodule, exports, __webpack_require__) { /***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = __webpack_require__(747); const fs_1 = __webpack_require__(747);
const os_1 = __webpack_require__(87); const os_1 = __webpack_require__(87);
class Context { class Context {
/** /**
* Hydrate the context from the environment * Hydrate the context from the environment
*/ */
constructor() { constructor() {
this.payload = {}; this.payload = {};
if (process.env.GITHUB_EVENT_PATH) { if (process.env.GITHUB_EVENT_PATH) {
if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) { if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' })); this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
} }
else { else {
process.stdout.write(`GITHUB_EVENT_PATH ${process.env.GITHUB_EVENT_PATH} does not exist${os_1.EOL}`); process.stdout.write(`GITHUB_EVENT_PATH ${process.env.GITHUB_EVENT_PATH} does not exist${os_1.EOL}`);
} }
} }
this.eventName = process.env.GITHUB_EVENT_NAME; this.eventName = process.env.GITHUB_EVENT_NAME;
this.sha = process.env.GITHUB_SHA; this.sha = process.env.GITHUB_SHA;
this.ref = process.env.GITHUB_REF; this.ref = process.env.GITHUB_REF;
this.workflow = process.env.GITHUB_WORKFLOW; this.workflow = process.env.GITHUB_WORKFLOW;
this.action = process.env.GITHUB_ACTION; this.action = process.env.GITHUB_ACTION;
this.actor = process.env.GITHUB_ACTOR; this.actor = process.env.GITHUB_ACTOR;
} }
get issue() { get issue() {
const payload = this.payload; const payload = this.payload;
return Object.assign({}, this.repo, { number: (payload.issue || payload.pullRequest || payload).number }); return Object.assign({}, this.repo, { number: (payload.issue || payload.pullRequest || payload).number });
} }
get repo() { get repo() {
if (process.env.GITHUB_REPOSITORY) { if (process.env.GITHUB_REPOSITORY) {
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
return { owner, repo }; return { owner, repo };
} }
if (this.payload.repository) { if (this.payload.repository) {
return { return {
owner: this.payload.repository.owner.login, owner: this.payload.repository.owner.login,
repo: this.payload.repository.name repo: this.payload.repository.name
}; };
} }
throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"); throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
} }
} }
exports.Context = Context; exports.Context = Context;
//# sourceMappingURL=context.js.map //# sourceMappingURL=context.js.map
/***/ }), /***/ }),
@ -4642,71 +4642,71 @@ function octokitValidate (octokit) {
/***/ (function(__unusedmodule, exports, __webpack_require__) { /***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const os = __webpack_require__(87); const os = __webpack_require__(87);
/** /**
* Commands * Commands
* *
* Command Format: * Command Format:
* ##[name key=value;key=value]message * ##[name key=value;key=value]message
* *
* Examples: * Examples:
* ##[warning]This is the user warning message * ##[warning]This is the user warning message
* ##[set-secret name=mypassword]definatelyNotAPassword! * ##[set-secret name=mypassword]definatelyNotAPassword!
*/ */
function issueCommand(command, properties, message) { function issueCommand(command, properties, message) {
const cmd = new Command(command, properties, message); const cmd = new Command(command, properties, message);
process.stdout.write(cmd.toString() + os.EOL); process.stdout.write(cmd.toString() + os.EOL);
} }
exports.issueCommand = issueCommand; exports.issueCommand = issueCommand;
function issue(name, message) { function issue(name, message) {
issueCommand(name, {}, message); issueCommand(name, {}, message);
} }
exports.issue = issue; exports.issue = issue;
const CMD_PREFIX = '##['; const CMD_PREFIX = '##[';
class Command { class Command {
constructor(command, properties, message) { constructor(command, properties, message) {
if (!command) { if (!command) {
command = 'missing.command'; command = 'missing.command';
} }
this.command = command; this.command = command;
this.properties = properties; this.properties = properties;
this.message = message; this.message = message;
} }
toString() { toString() {
let cmdStr = CMD_PREFIX + this.command; let cmdStr = CMD_PREFIX + this.command;
if (this.properties && Object.keys(this.properties).length > 0) { if (this.properties && Object.keys(this.properties).length > 0) {
cmdStr += ' '; cmdStr += ' ';
for (const key in this.properties) { for (const key in this.properties) {
if (this.properties.hasOwnProperty(key)) { if (this.properties.hasOwnProperty(key)) {
const val = this.properties[key]; const val = this.properties[key];
if (val) { if (val) {
// safely append the val - avoid blowing up when attempting to // safely append the val - avoid blowing up when attempting to
// call .replace() if message is not a string for some reason // call .replace() if message is not a string for some reason
cmdStr += `${key}=${escape(`${val || ''}`)};`; cmdStr += `${key}=${escape(`${val || ''}`)};`;
} }
} }
} }
} }
cmdStr += ']'; cmdStr += ']';
// safely append the message - avoid blowing up when attempting to // safely append the message - avoid blowing up when attempting to
// call .replace() if message is not a string for some reason // call .replace() if message is not a string for some reason
const message = `${this.message || ''}`; const message = `${this.message || ''}`;
cmdStr += escapeData(message); cmdStr += escapeData(message);
return cmdStr; return cmdStr;
} }
} }
function escapeData(s) { function escapeData(s) {
return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A'); return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
} }
function escape(s) { function escape(s) {
return s return s
.replace(/\r/g, '%0D') .replace(/\r/g, '%0D')
.replace(/\n/g, '%0A') .replace(/\n/g, '%0A')
.replace(/]/g, '%5D') .replace(/]/g, '%5D')
.replace(/;/g, '%3B'); .replace(/;/g, '%3B');
} }
//# sourceMappingURL=command.js.map //# sourceMappingURL=command.js.map
/***/ }), /***/ }),
@ -6569,34 +6569,34 @@ exports.RequestError = RequestError;
/***/ (function(__unusedmodule, exports, __webpack_require__) { /***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict"; "use strict";
var __importDefault = (this && this.__importDefault) || function (mod) { var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod; result["default"] = mod;
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
// Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
const graphql_1 = __webpack_require__(503); const graphql_1 = __webpack_require__(503);
const rest_1 = __importDefault(__webpack_require__(613)); const rest_1 = __importDefault(__webpack_require__(613));
const Context = __importStar(__webpack_require__(262)); const Context = __importStar(__webpack_require__(262));
// We need this in order to extend Octokit // We need this in order to extend Octokit
rest_1.default.prototype = new rest_1.default(); rest_1.default.prototype = new rest_1.default();
exports.context = new Context.Context(); exports.context = new Context.Context();
class GitHub extends rest_1.default { class GitHub extends rest_1.default {
constructor(token) { constructor(token) {
super({ auth: `token ${token}` }); super({ auth: `token ${token}` });
this.graphql = graphql_1.defaults({ this.graphql = graphql_1.defaults({
headers: { authorization: `token ${token}` } headers: { authorization: `token ${token}` }
}); });
} }
} }
exports.GitHub = GitHub; exports.GitHub = GitHub;
//# sourceMappingURL=github.js.map //# sourceMappingURL=github.js.map
/***/ }), /***/ }),
@ -6605,121 +6605,121 @@ exports.GitHub = GitHub;
/***/ (function(__unusedmodule, exports, __webpack_require__) { /***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const command_1 = __webpack_require__(431); const command_1 = __webpack_require__(431);
const path = __webpack_require__(622); const path = __webpack_require__(622);
/** /**
* The code to exit an action * The code to exit an action
*/ */
var ExitCode; var ExitCode;
(function (ExitCode) { (function (ExitCode) {
/** /**
* A code indicating that the action was successful * A code indicating that the action was successful
*/ */
ExitCode[ExitCode["Success"] = 0] = "Success"; ExitCode[ExitCode["Success"] = 0] = "Success";
/** /**
* A code indicating that the action was a failure * A code indicating that the action was a failure
*/ */
ExitCode[ExitCode["Failure"] = 1] = "Failure"; ExitCode[ExitCode["Failure"] = 1] = "Failure";
})(ExitCode = exports.ExitCode || (exports.ExitCode = {})); })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// Variables // Variables
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
/** /**
* sets env variable for this action and future actions in the job * sets env variable for this action and future actions in the job
* @param name the name of the variable to set * @param name the name of the variable to set
* @param val the value of the variable * @param val the value of the variable
*/ */
function exportVariable(name, val) { function exportVariable(name, val) {
process.env[name] = val; process.env[name] = val;
command_1.issueCommand('set-env', { name }, val); command_1.issueCommand('set-env', { name }, val);
} }
exports.exportVariable = exportVariable; exports.exportVariable = exportVariable;
/** /**
* exports the variable and registers a secret which will get masked from logs * exports the variable and registers a secret which will get masked from logs
* @param name the name of the variable to set * @param name the name of the variable to set
* @param val value of the secret * @param val value of the secret
*/ */
function exportSecret(name, val) { function exportSecret(name, val) {
exportVariable(name, val); exportVariable(name, val);
command_1.issueCommand('set-secret', {}, val); command_1.issueCommand('set-secret', {}, val);
} }
exports.exportSecret = exportSecret; exports.exportSecret = exportSecret;
/** /**
* Prepends inputPath to the PATH (for this action and future actions) * Prepends inputPath to the PATH (for this action and future actions)
* @param inputPath * @param inputPath
*/ */
function addPath(inputPath) { function addPath(inputPath) {
command_1.issueCommand('add-path', {}, inputPath); command_1.issueCommand('add-path', {}, inputPath);
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
} }
exports.addPath = addPath; exports.addPath = addPath;
/** /**
* Gets the value of an input. The value is also trimmed. * Gets the value of an input. The value is also trimmed.
* *
* @param name name of the input to get * @param name name of the input to get
* @param options optional. See InputOptions. * @param options optional. See InputOptions.
* @returns string * @returns string
*/ */
function getInput(name, options) { function getInput(name, options) {
const val = process.env[`INPUT_${name.replace(' ', '_').toUpperCase()}`] || ''; const val = process.env[`INPUT_${name.replace(' ', '_').toUpperCase()}`] || '';
if (options && options.required && !val) { if (options && options.required && !val) {
throw new Error(`Input required and not supplied: ${name}`); throw new Error(`Input required and not supplied: ${name}`);
} }
return val.trim(); return val.trim();
} }
exports.getInput = getInput; exports.getInput = getInput;
/** /**
* Sets the value of an output. * Sets the value of an output.
* *
* @param name name of the output to set * @param name name of the output to set
* @param value value to store * @param value value to store
*/ */
function setOutput(name, value) { function setOutput(name, value) {
command_1.issueCommand('set-output', { name }, value); command_1.issueCommand('set-output', { name }, value);
} }
exports.setOutput = setOutput; exports.setOutput = setOutput;
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// Results // Results
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
/** /**
* Sets the action status to failed. * Sets the action status to failed.
* When the action exits it will be with an exit code of 1 * When the action exits it will be with an exit code of 1
* @param message add error issue message * @param message add error issue message
*/ */
function setFailed(message) { function setFailed(message) {
process.exitCode = ExitCode.Failure; process.exitCode = ExitCode.Failure;
error(message); error(message);
} }
exports.setFailed = setFailed; exports.setFailed = setFailed;
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// Logging Commands // Logging Commands
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
/** /**
* Writes debug message to user log * Writes debug message to user log
* @param message debug message * @param message debug message
*/ */
function debug(message) { function debug(message) {
command_1.issueCommand('debug', {}, message); command_1.issueCommand('debug', {}, message);
} }
exports.debug = debug; exports.debug = debug;
/** /**
* Adds an error issue * Adds an error issue
* @param message error issue message * @param message error issue message
*/ */
function error(message) { function error(message) {
command_1.issue('error', message); command_1.issue('error', message);
} }
exports.error = error; exports.error = error;
/** /**
* Adds an warning issue * Adds an warning issue
* @param message warning issue message * @param message warning issue message
*/ */
function warning(message) { function warning(message) {
command_1.issue('warning', message); command_1.issue('warning', message);
} }
exports.warning = warning; exports.warning = warning;
//# sourceMappingURL=core.js.map //# sourceMappingURL=core.js.map
/***/ }), /***/ }),
@ -7861,10 +7861,11 @@ async function run() {
// 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 = tagName.replace('refs/tags/', ''); const tag = tagName.replace('refs/tags/', '');
const releaseName = core.getInput('release_name', { required: true }).replace('refs/tags/', ''); const releaseName = core.getInput('release_name', { required: false }).replace('refs/tags/', '');
const body = core.getInput('body', { required: false }); const body = core.getInput('body', { required: false });
const draft = core.getInput('draft', { required: false }) === 'true'; const draft = core.getInput('draft', { required: false }) === 'true';
const prerelease = core.getInput('prerelease', { required: false }) === 'true'; const prerelease = core.getInput('prerelease', { required: false }) === 'true';
const commitish = core.getInput('commitish', { required: false }) || context.sha;
const bodyPath = core.getInput('body_path', { required: false }); const bodyPath = core.getInput('body_path', { required: false });
let bodyFileContent = null; let bodyFileContent = null;
@ -7886,7 +7887,8 @@ async function run() {
name: releaseName, name: releaseName,
body: bodyFileContent || body, body: bodyFileContent || body,
draft, draft,
prerelease prerelease,
target_commitish: commitish
}); });
// 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
@ -11034,4 +11036,4 @@ function onceStrict (fn) {
/***/ }) /***/ })
/******/ }); /******/ });

195
package-lock.json generated
View File

@ -15,12 +15,21 @@
"integrity": "sha512-nquH0+XKng+Ll7rZfCojN7NWSbnGh+ltwUJhzfbLkmOJgxocGX2/yXcZLMyT9fa7+tByEow/NSTrBExNlEj9fw==" "integrity": "sha512-nquH0+XKng+Ll7rZfCojN7NWSbnGh+ltwUJhzfbLkmOJgxocGX2/yXcZLMyT9fa7+tByEow/NSTrBExNlEj9fw=="
}, },
"@actions/github": { "@actions/github": {
"version": "1.0.1", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/@actions/github/-/github-1.0.1.tgz", "resolved": "https://registry.npmjs.org/@actions/github/-/github-2.2.0.tgz",
"integrity": "sha512-fmji0JB0E4vmtXVjnqCJouLP4AyM/B5nbLe9U9ooPerxXh9r+VBlx8Lh5c+Dlvux1GooUduQxy4XVA21Lfs/Wg==", "integrity": "sha512-9UAZqn8ywdR70n3GwVle4N8ALosQs4z50N7XMXrSTUVOmVpaBC5kE3TRTT7qQdi3OaQV24mjGuJZsHUmhD+ZXw==",
"requires": { "requires": {
"@octokit/graphql": "^2.0.1", "@actions/http-client": "^1.0.3",
"@octokit/rest": "^16.15.0" "@octokit/graphql": "^4.3.1",
"@octokit/rest": "^16.43.1"
}
},
"@actions/http-client": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.8.tgz",
"integrity": "sha512-G4JjJ6f9Hb3Zvejj+ewLLKLf99ZC+9v+yCxoYf9vSyH+WkzPLB2LuUtRMGNkooMqdugGBFStIKXOuvH1W+EctA==",
"requires": {
"tunnel": "0.0.6"
} }
}, },
"@babel/code-frame": { "@babel/code-frame": {
@ -436,73 +445,91 @@
"@types/yargs": "^13.0.0" "@types/yargs": "^13.0.0"
} }
}, },
"@octokit/endpoint": { "@octokit/auth-token": {
"version": "5.3.4", "version": "2.4.0",
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.3.4.tgz", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.0.tgz",
"integrity": "sha512-DNkTvTUs1hobAjtHDkVwspKihZk9HnZI2zbfHqLOzTzZiAWP38QypTsyXXbg0FiuVDbx2A6cWyc+ooLFewNXSg==", "integrity": "sha512-eoOVMjILna7FVQf96iWc3+ZtE/ZT6y8ob8ZzcqKY1ibSQCnu4O/B7pJvzMx5cyZ/RjAff6DAdEb0O0Cjcxidkg==",
"requires": { "requires": {
"@octokit/types": "^2.0.0"
}
},
"@octokit/endpoint": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.1.tgz",
"integrity": "sha512-pOPHaSz57SFT/m3R5P8MUu4wLPszokn5pXcB/pzavLTQf2jbU+6iayTvzaY6/BiotuRS0qyEUkx3QglT4U958A==",
"requires": {
"@octokit/types": "^2.11.1",
"is-plain-object": "^3.0.0", "is-plain-object": "^3.0.0",
"universal-user-agent": "^3.0.0" "universal-user-agent": "^5.0.0"
},
"dependencies": {
"universal-user-agent": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-3.0.0.tgz",
"integrity": "sha512-T3siHThqoj5X0benA5H0qcDnrKGXzU8TKoX15x/tQHw1hQBvIEBHjxQ2klizYsqBOO/Q+WuxoQUihadeeqDnoA==",
"requires": {
"os-name": "^3.0.0"
}
}
} }
}, },
"@octokit/graphql": { "@octokit/graphql": {
"version": "2.1.3", "version": "4.4.0",
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-2.1.3.tgz", "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.4.0.tgz",
"integrity": "sha512-XoXJqL2ondwdnMIW3wtqJWEwcBfKk37jO/rYkoxNPEVeLBDGsGO1TCWggrAlq3keGt/O+C/7VepXnukUxwt5vA==", "integrity": "sha512-Du3hAaSROQ8EatmYoSAJjzAz3t79t9Opj/WY1zUgxVUGfIKn0AEjg+hlOLscF6fv6i/4y/CeUvsWgIfwMkTccw==",
"requires": { "requires": {
"@octokit/request": "^5.0.0", "@octokit/request": "^5.3.0",
"universal-user-agent": "^2.0.3" "@octokit/types": "^2.0.0",
"universal-user-agent": "^5.0.0"
}
},
"@octokit/plugin-paginate-rest": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-1.1.2.tgz",
"integrity": "sha512-jbsSoi5Q1pj63sC16XIUboklNw+8tL9VOnJsWycWYR78TKss5PVpIPb1TUUcMQ+bBh7cY579cVAWmf5qG+dw+Q==",
"requires": {
"@octokit/types": "^2.0.1"
}
},
"@octokit/plugin-request-log": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.0.tgz",
"integrity": "sha512-ywoxP68aOT3zHCLgWZgwUJatiENeHE7xJzYjfz8WI0goynp96wETBF+d95b8g/uL4QmS6owPVlaxiz3wyMAzcw=="
},
"@octokit/plugin-rest-endpoint-methods": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-2.4.0.tgz",
"integrity": "sha512-EZi/AWhtkdfAYi01obpX0DF7U6b1VRr30QNQ5xSFPITMdLSfhcBqjamE3F+sKcxPbD7eZuMHu3Qkk2V+JGxBDQ==",
"requires": {
"@octokit/types": "^2.0.1",
"deprecation": "^2.3.1"
} }
}, },
"@octokit/request": { "@octokit/request": {
"version": "5.0.2", "version": "5.4.2",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.0.2.tgz", "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.2.tgz",
"integrity": "sha512-z1BQr43g4kOL4ZrIVBMHwi68Yg9VbkRUyuAgqCp1rU3vbYa69+2gIld/+gHclw15bJWQnhqqyEb7h5a5EqgZ0A==", "integrity": "sha512-zKdnGuQ2TQ2vFk9VU8awFT4+EYf92Z/v3OlzRaSh4RIP0H6cvW1BFPXq4XYvNez+TPQjqN+0uSkCYnMFFhcFrw==",
"requires": { "requires": {
"@octokit/endpoint": "^5.1.0", "@octokit/endpoint": "^6.0.1",
"@octokit/request-error": "^1.0.1", "@octokit/request-error": "^2.0.0",
"@octokit/types": "^2.11.1",
"deprecation": "^2.0.0", "deprecation": "^2.0.0",
"is-plain-object": "^3.0.0", "is-plain-object": "^3.0.0",
"node-fetch": "^2.3.0", "node-fetch": "^2.3.0",
"once": "^1.4.0", "once": "^1.4.0",
"universal-user-agent": "^3.0.0" "universal-user-agent": "^5.0.0"
},
"dependencies": {
"universal-user-agent": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-3.0.0.tgz",
"integrity": "sha512-T3siHThqoj5X0benA5H0qcDnrKGXzU8TKoX15x/tQHw1hQBvIEBHjxQ2klizYsqBOO/Q+WuxoQUihadeeqDnoA==",
"requires": {
"os-name": "^3.0.0"
}
}
} }
}, },
"@octokit/request-error": { "@octokit/request-error": {
"version": "1.0.4", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.0.4.tgz", "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.0.tgz",
"integrity": "sha512-L4JaJDXn8SGT+5G0uX79rZLv0MNJmfGa4vb4vy1NnpjSnWDLJRy6m90udGwvMmavwsStgbv2QNkPzzTCMmL+ig==", "integrity": "sha512-rtYicB4Absc60rUv74Rjpzek84UbVHGHJRu4fNVlZ1mCcyUPPuzFfG9Rn6sjHrd95DEsmjSt1Axlc699ZlbDkw==",
"requires": { "requires": {
"@octokit/types": "^2.0.0",
"deprecation": "^2.0.0", "deprecation": "^2.0.0",
"once": "^1.4.0" "once": "^1.4.0"
} }
}, },
"@octokit/rest": { "@octokit/rest": {
"version": "16.28.8", "version": "16.43.1",
"resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.28.8.tgz", "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.43.1.tgz",
"integrity": "sha512-FouTTcLdT++gwgKVnBN8CEVeFvY/OKzeaoH/L9LBvZhbjUotLthFWAdKa8WeOMt5x7Rs7uvBpu7IdcrtRD3wBA==", "integrity": "sha512-gfFKwRT/wFxq5qlNjnW2dh+qh74XgTQ2B179UX5K1HYCluioWj8Ndbgqw2PVqa1NnVJkGHp2ovMpVn/DImlmkw==",
"requires": { "requires": {
"@octokit/request": "^5.0.0", "@octokit/auth-token": "^2.4.0",
"@octokit/plugin-paginate-rest": "^1.1.1",
"@octokit/plugin-request-log": "^1.0.0",
"@octokit/plugin-rest-endpoint-methods": "2.4.0",
"@octokit/request": "^5.2.0",
"@octokit/request-error": "^1.0.2", "@octokit/request-error": "^1.0.2",
"atob-lite": "^2.0.0", "atob-lite": "^2.0.0",
"before-after-hook": "^2.0.0", "before-after-hook": "^2.0.0",
@ -513,19 +540,37 @@
"lodash.uniq": "^4.5.0", "lodash.uniq": "^4.5.0",
"octokit-pagination-methods": "^1.1.0", "octokit-pagination-methods": "^1.1.0",
"once": "^1.4.0", "once": "^1.4.0",
"universal-user-agent": "^3.0.0" "universal-user-agent": "^4.0.0"
}, },
"dependencies": { "dependencies": {
"universal-user-agent": { "@octokit/request-error": {
"version": "3.0.0", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-3.0.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz",
"integrity": "sha512-T3siHThqoj5X0benA5H0qcDnrKGXzU8TKoX15x/tQHw1hQBvIEBHjxQ2klizYsqBOO/Q+WuxoQUihadeeqDnoA==", "integrity": "sha512-+6yDyk1EES6WK+l3viRDElw96MvwfJxCt45GvmjDUKWjYIb3PJZQkq3i46TwGwoPD4h8NmTrENmtyA1FwbmhRA==",
"requires": { "requires": {
"os-name": "^3.0.0" "@octokit/types": "^2.0.0",
"deprecation": "^2.0.0",
"once": "^1.4.0"
}
},
"universal-user-agent": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz",
"integrity": "sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg==",
"requires": {
"os-name": "^3.1.0"
} }
} }
} }
}, },
"@octokit/types": {
"version": "2.16.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.0.tgz",
"integrity": "sha512-hA06ZYqkAVxvwFVu7yqRNVBGfG9MZvLMbqfgfm6F79g5xWspxsbL/2/rHcFP/z1YBN3zbcNQYuUHiBml4b24MA==",
"requires": {
"@types/node": ">= 8"
}
},
"@types/babel__core": { "@types/babel__core": {
"version": "7.1.3", "version": "7.1.3",
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.3.tgz", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.3.tgz",
@ -592,6 +637,11 @@
"@types/istanbul-lib-report": "*" "@types/istanbul-lib-report": "*"
} }
}, },
"@types/node": {
"version": "13.13.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.5.tgz",
"integrity": "sha512-3ySmiBYJPqgjiHA7oEaIo2Rzz0HrOZ7yrNO5HWyaE5q0lQ3BppDZ3N53Miz8bw2I7gh1/zir2MGVZBvpb1zq9g=="
},
"@types/normalize-package-data": { "@types/normalize-package-data": {
"version": "2.4.0", "version": "2.4.0",
"resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
@ -632,9 +682,9 @@
"dev": true "dev": true
}, },
"acorn": { "acorn": {
"version": "6.3.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz", "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz",
"integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==", "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==",
"dev": true "dev": true
}, },
"acorn-globals": { "acorn-globals": {
@ -2982,9 +3032,9 @@
"dev": true "dev": true
}, },
"handlebars": { "handlebars": {
"version": "4.2.1", "version": "4.5.3",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.2.1.tgz", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz",
"integrity": "sha512-bqPIlDk06UWbVEIFoYj+LVo42WhK96J+b25l7hbFDpxrOXMphFM3fNIm+cluwg4Pk2jiLjWU5nHQY7igGE75NQ==", "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==",
"dev": true, "dev": true,
"requires": { "requires": {
"neo-async": "^2.6.0", "neo-async": "^2.6.0",
@ -4164,9 +4214,9 @@
}, },
"dependencies": { "dependencies": {
"acorn": { "acorn": {
"version": "5.7.3", "version": "5.7.4",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz",
"integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==",
"dev": true "dev": true
} }
} }
@ -6105,6 +6155,11 @@
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==",
"dev": true "dev": true
}, },
"tunnel": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
},
"tunnel-agent": { "tunnel-agent": {
"version": "0.6.0", "version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
@ -6159,11 +6214,11 @@
} }
}, },
"universal-user-agent": { "universal-user-agent": {
"version": "2.1.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-2.1.0.tgz", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz",
"integrity": "sha512-8itiX7G05Tu3mGDTdNY2fB4KJ8MgZLS54RdG6PkkfwMAavrXu1mV/lls/GABx9O3Rw4PnTtasxrvbMQoBYY92Q==", "integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==",
"requires": { "requires": {
"os-name": "^3.0.0" "os-name": "^3.1.0"
} }
}, },
"unset-value": { "unset-value": {
@ -6335,9 +6390,9 @@
"dev": true "dev": true
}, },
"windows-release": { "windows-release": {
"version": "3.2.0", "version": "3.3.0",
"resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.2.0.tgz", "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.0.tgz",
"integrity": "sha512-QTlz2hKLrdqukrsapKsINzqMgOUpQW268eJ0OaOpJN32h272waxR9fkB9VoWRtK7uKHG5EHJcTXQBD8XZVJkFA==", "integrity": "sha512-2HetyTg1Y+R+rUgrKeUEhAG/ZuOmTrI1NBb3ZyAGQMYmOJjBBPe4MTodghRkmLJZHwkuPi02anbeGP+Zf401LQ==",
"requires": { "requires": {
"execa": "^1.0.0" "execa": "^1.0.0"
} }

View File

@ -22,7 +22,7 @@
"dependencies": { "dependencies": {
"@actions/core": "^1.0.0", "@actions/core": "^1.0.0",
"@actions/exec": "^1.0.0", "@actions/exec": "^1.0.0",
"@actions/github": "^1.0.0" "@actions/github": "^2.2.0"
}, },
"devDependencies": { "devDependencies": {
"@zeit/ncc": "^0.20.4", "@zeit/ncc": "^0.20.4",

View File

@ -15,10 +15,11 @@ async function run() {
// 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 = tagName.replace('refs/tags/', ''); const tag = tagName.replace('refs/tags/', '');
const releaseName = core.getInput('release_name', { required: true }).replace('refs/tags/', ''); const releaseName = core.getInput('release_name', { required: false }).replace('refs/tags/', '');
const body = core.getInput('body', { required: false }); const body = core.getInput('body', { required: false });
const draft = core.getInput('draft', { required: false }) === 'true'; const draft = core.getInput('draft', { required: false }) === 'true';
const prerelease = core.getInput('prerelease', { required: false }) === 'true'; const prerelease = core.getInput('prerelease', { required: false }) === 'true';
const commitish = core.getInput('commitish', { required: false }) || context.sha;
const bodyPath = core.getInput('body_path', { required: false }); const bodyPath = core.getInput('body_path', { required: false });
let bodyFileContent = null; let bodyFileContent = null;
@ -40,7 +41,8 @@ async function run() {
name: releaseName, name: releaseName,
body: bodyFileContent || body, body: bodyFileContent || body,
draft, draft,
prerelease prerelease,
target_commitish: commitish
}); });
// 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

View File

@ -24,6 +24,7 @@ describe('Create Release', () => {
owner: 'owner', owner: 'owner',
repo: 'repo' repo: 'repo'
}; };
context.sha = 'sha';
const github = { const github = {
repos: { repos: {
@ -52,7 +53,8 @@ describe('Create Release', () => {
name: 'myRelease', name: 'myRelease',
body: 'myBody', body: 'myBody',
draft: false, draft: false,
prerelease: false prerelease: false,
target_commitish: 'sha'
}); });
}); });
@ -74,7 +76,8 @@ describe('Create Release', () => {
name: 'myRelease', name: 'myRelease',
body: 'myBody', body: 'myBody',
draft: true, draft: true,
prerelease: false prerelease: false,
target_commitish: 'sha'
}); });
}); });
@ -96,7 +99,8 @@ describe('Create Release', () => {
name: 'myRelease', name: 'myRelease',
body: 'myBody', body: 'myBody',
draft: false, draft: false,
prerelease: true prerelease: true,
target_commitish: 'sha'
}); });
}); });
@ -118,7 +122,8 @@ describe('Create Release', () => {
name: 'myRelease', name: 'myRelease',
body: '', body: '',
draft: false, draft: false,
prerelease: false prerelease: false,
target_commitish: 'sha'
}); });
}); });