Merge pull request #32 from fleskesvor/feature/support-target-commitish

Tag and release on a specific commitish
This commit is contained in:
Mike Coutermarsh 2020-06-16 12:24:20 -07:00 committed by GitHub
commit e9dc4ac22d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1035 additions and 15268 deletions

View File

@ -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'

15861
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -18,6 +18,7 @@ async function run() {
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

View File

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