Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const core = require('@actions/core')
const { GitHubRelease } = require('release-please/build/src/github-release')
const { ReleasePRFactory } = require('release-please/build/src/release-pr-factory')
const { ReleasePR } = require('release-please/build/src/release-pr')

const RELEASE_LABEL = 'autorelease: pending'

Expand Down Expand Up @@ -51,7 +51,9 @@ async function main () {
// Next we check for PRs merged since the last release, and groom the
// release PR:
if (!command || command === 'release-pr') {
const release = releasePlease.getReleasePRFactory().buildStatic(releaseType, {
const GithubReleasePR = releasePlease.getReleasePR()
const release = new GithubReleasePR({
releaseType,
monorepoTags,
packageName,
path,
Expand All @@ -65,6 +67,7 @@ async function main () {
versionFile,
defaultBranch
})

const pr = await release.run()
if (pr) {
core.setOutput('pr', pr)
Expand All @@ -76,14 +79,14 @@ function getGitHubRelease () {
return GitHubRelease
}

function getReleasePRFactory () {
return ReleasePRFactory
function getReleasePR () {
return ReleasePR
}

const releasePlease = {
main,
getGitHubRelease,
getReleasePRFactory
getReleasePR
}

if (require.main === module) {
Expand Down
Loading