mirror of
https://github.com/actions/create-release.git
synced 2025-06-14 12:57:43 +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`'
|
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'
|
||||||
|
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 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;
|
||||||
|
|
||||||
// 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
|
||||||
@ -29,7 +30,8 @@ async function run() {
|
|||||||
name: releaseName,
|
name: releaseName,
|
||||||
body,
|
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
|
||||||
|
@ -22,6 +22,7 @@ describe('Create Release', () => {
|
|||||||
owner: 'owner',
|
owner: 'owner',
|
||||||
repo: 'repo'
|
repo: 'repo'
|
||||||
};
|
};
|
||||||
|
context.sha = 'sha';
|
||||||
|
|
||||||
const github = {
|
const github = {
|
||||||
repos: {
|
repos: {
|
||||||
@ -50,7 +51,8 @@ describe('Create Release', () => {
|
|||||||
name: 'myRelease',
|
name: 'myRelease',
|
||||||
body: 'myBody',
|
body: 'myBody',
|
||||||
draft: false,
|
draft: false,
|
||||||
prerelease: false
|
prerelease: false,
|
||||||
|
target_commitish: 'sha'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -72,7 +74,8 @@ describe('Create Release', () => {
|
|||||||
name: 'myRelease',
|
name: 'myRelease',
|
||||||
body: 'myBody',
|
body: 'myBody',
|
||||||
draft: true,
|
draft: true,
|
||||||
prerelease: false
|
prerelease: false,
|
||||||
|
target_commitish: 'sha'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -94,7 +97,8 @@ describe('Create Release', () => {
|
|||||||
name: 'myRelease',
|
name: 'myRelease',
|
||||||
body: 'myBody',
|
body: 'myBody',
|
||||||
draft: false,
|
draft: false,
|
||||||
prerelease: true
|
prerelease: true,
|
||||||
|
target_commitish: 'sha'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -116,7 +120,8 @@ describe('Create Release', () => {
|
|||||||
name: 'myRelease',
|
name: 'myRelease',
|
||||||
body: '',
|
body: '',
|
||||||
draft: false,
|
draft: false,
|
||||||
prerelease: false
|
prerelease: false,
|
||||||
|
target_commitish: 'sha'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user