mirror of
https://github.com/joaquinjsb/gitea-release-please-action
synced 2026-05-14 07:31:34 +02:00
feat(release-please): add default branch input option for github release (#206)
This commit is contained in:
3
index.js
3
index.js
@@ -36,7 +36,8 @@ async function main () {
|
|||||||
monorepoTags,
|
monorepoTags,
|
||||||
token,
|
token,
|
||||||
changelogPath,
|
changelogPath,
|
||||||
releaseType
|
releaseType,
|
||||||
|
defaultBranch
|
||||||
})
|
})
|
||||||
const releaseCreated = await gr.createRelease()
|
const releaseCreated = await gr.createRelease()
|
||||||
if (releaseCreated) {
|
if (releaseCreated) {
|
||||||
|
|||||||
@@ -20,10 +20,17 @@ describe('release-please-action', () => {
|
|||||||
upload_url: 'http://example.com',
|
upload_url: 'http://example.com',
|
||||||
tag_name: 'v1.0.0'
|
tag_name: 'v1.0.0'
|
||||||
})
|
})
|
||||||
|
let ReleaseStub = sinon.stub()
|
||||||
action.getGitHubRelease = () => {
|
action.getGitHubRelease = () => {
|
||||||
class Release {}
|
class Release {
|
||||||
Release.prototype.createRelease = createRelease
|
createRelease () {}
|
||||||
return Release
|
}
|
||||||
|
ReleaseStub = sinon.spy(function () {
|
||||||
|
const instance = sinon.createStubInstance(Release)
|
||||||
|
instance.createRelease = createRelease
|
||||||
|
return instance
|
||||||
|
})
|
||||||
|
return ReleaseStub
|
||||||
}
|
}
|
||||||
const releasePR = sinon.stub().returns(25)
|
const releasePR = sinon.stub().returns(25)
|
||||||
const buildStatic = sinon.stub().returns({
|
const buildStatic = sinon.stub().returns({
|
||||||
@@ -36,6 +43,7 @@ describe('release-please-action', () => {
|
|||||||
}
|
}
|
||||||
await action.main()
|
await action.main()
|
||||||
sinon.assert.calledOnce(createRelease)
|
sinon.assert.calledOnce(createRelease)
|
||||||
|
sinon.assert.calledWith(ReleaseStub, sinon.match.hasOwn('defaultBranch', undefined))
|
||||||
sinon.assert.calledWith(buildStatic, 'node', sinon.match.hasOwn('defaultBranch', undefined))
|
sinon.assert.calledWith(buildStatic, 'node', sinon.match.hasOwn('defaultBranch', undefined))
|
||||||
sinon.assert.calledOnce(releasePR)
|
sinon.assert.calledOnce(releasePR)
|
||||||
assert.deepStrictEqual(output, {
|
assert.deepStrictEqual(output, {
|
||||||
@@ -62,10 +70,18 @@ describe('release-please-action', () => {
|
|||||||
upload_url: 'http://example.com',
|
upload_url: 'http://example.com',
|
||||||
tag_name: 'v1.0.0'
|
tag_name: 'v1.0.0'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
let ReleaseStub = sinon.stub()
|
||||||
action.getGitHubRelease = () => {
|
action.getGitHubRelease = () => {
|
||||||
class Release {}
|
class Release {
|
||||||
Release.prototype.createRelease = createRelease
|
createRelease () {}
|
||||||
return Release
|
}
|
||||||
|
ReleaseStub = sinon.spy(function () {
|
||||||
|
const instance = sinon.createStubInstance(Release)
|
||||||
|
instance.createRelease = createRelease
|
||||||
|
return instance
|
||||||
|
})
|
||||||
|
return ReleaseStub
|
||||||
}
|
}
|
||||||
const releasePR = sinon.stub().returns(25)
|
const releasePR = sinon.stub().returns(25)
|
||||||
const buildStatic = sinon.stub().returns({
|
const buildStatic = sinon.stub().returns({
|
||||||
@@ -78,6 +94,7 @@ describe('release-please-action', () => {
|
|||||||
}
|
}
|
||||||
await action.main()
|
await action.main()
|
||||||
sinon.assert.calledOnce(createRelease)
|
sinon.assert.calledOnce(createRelease)
|
||||||
|
sinon.assert.calledWith(ReleaseStub, sinon.match.hasOwn('defaultBranch', 'dev'))
|
||||||
sinon.assert.calledWith(buildStatic, 'node', sinon.match.hasOwn('defaultBranch', 'dev'))
|
sinon.assert.calledWith(buildStatic, 'node', sinon.match.hasOwn('defaultBranch', 'dev'))
|
||||||
sinon.assert.calledOnce(releasePR)
|
sinon.assert.calledOnce(releasePR)
|
||||||
assert.deepStrictEqual(output, {
|
assert.deepStrictEqual(output, {
|
||||||
|
|||||||
Reference in New Issue
Block a user