Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9dc4ac22d | ||
|
|
62b2b8381c | ||
|
|
d28992e4ca | ||
|
|
80985fc475 | ||
|
|
1a72e235c1 | ||
|
|
2b67105e25 |
@@ -19,6 +19,9 @@ inputs:
|
||||
description: '`true` to identify the release as a prerelease. `false` to identify the release as a full release. Default: `false`'
|
||||
required: 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:
|
||||
id:
|
||||
description: 'The ID of the created Release'
|
||||
|
||||
16283
dist/index.js
vendored
16283
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -14,10 +14,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'
|
||||
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 draft = core.getInput('draft', { required: false }) === 'true';
|
||||
const prerelease = core.getInput('prerelease', { required: false }) === 'true';
|
||||
const commitish = core.getInput('commitish', { required: false }) || context.sha;
|
||||
|
||||
// Create a release
|
||||
// API Documentation: https://developer.github.com/v3/repos/releases/#create-a-release
|
||||
@@ -29,7 +30,8 @@ async function run() {
|
||||
name: releaseName,
|
||||
body,
|
||||
draft,
|
||||
prerelease
|
||||
prerelease,
|
||||
target_commitish: commitish
|
||||
});
|
||||
|
||||
// Get the ID, html_url, and upload URL for the created Release from the response
|
||||
|
||||
@@ -22,6 +22,7 @@ describe('Create Release', () => {
|
||||
owner: 'owner',
|
||||
repo: 'repo'
|
||||
};
|
||||
context.sha = 'sha';
|
||||
|
||||
const github = {
|
||||
repos: {
|
||||
@@ -50,7 +51,8 @@ describe('Create Release', () => {
|
||||
name: 'myRelease',
|
||||
body: 'myBody',
|
||||
draft: false,
|
||||
prerelease: false
|
||||
prerelease: false,
|
||||
target_commitish: 'sha'
|
||||
});
|
||||
});
|
||||
|
||||
@@ -72,7 +74,8 @@ describe('Create Release', () => {
|
||||
name: 'myRelease',
|
||||
body: 'myBody',
|
||||
draft: true,
|
||||
prerelease: false
|
||||
prerelease: false,
|
||||
target_commitish: 'sha'
|
||||
});
|
||||
});
|
||||
|
||||
@@ -94,7 +97,8 @@ describe('Create Release', () => {
|
||||
name: 'myRelease',
|
||||
body: 'myBody',
|
||||
draft: false,
|
||||
prerelease: true
|
||||
prerelease: true,
|
||||
target_commitish: 'sha'
|
||||
});
|
||||
});
|
||||
|
||||
@@ -116,7 +120,8 @@ describe('Create Release', () => {
|
||||
name: 'myRelease',
|
||||
body: '',
|
||||
draft: false,
|
||||
prerelease: false
|
||||
prerelease: false,
|
||||
target_commitish: 'sha'
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user