mirror of
https://github.com/actions/create-release.git
synced 2025-06-14 04:47:44 +00:00
Merge pull request #32 from fleskesvor/feature/support-target-commitish
Tag and release on a specific commitish
This commit is contained in:
commit
e9dc4ac22d
@ -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
@ -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
|
||||
|
@ -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'
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user