mirror of
https://forgejo.stefka.eu/jiriks74/create-pull-request.git
synced 2025-01-18 16:01:06 +01:00
build branch commits when there is a diff with the base
This commit is contained in:
parent
2ba41ede85
commit
32e97fc746
3 changed files with 12 additions and 11 deletions
|
@ -144,8 +144,7 @@ export async function createOrUpdateBranch(
|
|||
branch: string,
|
||||
branchRemoteName: string,
|
||||
signoff: boolean,
|
||||
addPaths: string[],
|
||||
signCommits: boolean = false
|
||||
addPaths: string[]
|
||||
): Promise<CreateOrUpdateBranchResult> {
|
||||
// Get the working base.
|
||||
// When a ref, it may or may not be the actual base.
|
||||
|
@ -316,8 +315,7 @@ export async function createOrUpdateBranch(
|
|||
result.baseSha = await git.revParse(base)
|
||||
result.headSha = await git.revParse(branch)
|
||||
|
||||
// NOTE: This could always be built and returned. Maybe remove when there is confidence in buildBranchCommits.
|
||||
if (signCommits) {
|
||||
if (result.hasDiffWithBase) {
|
||||
// Build the branch commits
|
||||
result.branchCommits = await buildBranchCommits(git, base, branch)
|
||||
}
|
||||
|
|
|
@ -192,8 +192,7 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
|
|||
inputs.branch,
|
||||
branchRemoteName,
|
||||
inputs.signoff,
|
||||
inputs.addPaths,
|
||||
inputs.signCommits
|
||||
inputs.addPaths
|
||||
)
|
||||
outputs.set('pull-request-head-sha', result.headSha)
|
||||
// Set the base. It would have been '' if not specified as an input
|
||||
|
@ -235,6 +234,9 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
|
|||
core.endGroup()
|
||||
}
|
||||
|
||||
// If the verified output is not set yet, and there are commits (from result), and the head commit is signed, then:
|
||||
// Get the commit and check verification status
|
||||
|
||||
if (result.hasDiffWithBase) {
|
||||
core.startGroup('Create or update the pull request')
|
||||
const pull = await ghPull.createOrUpdatePullRequest(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue