mirror of
https://forgejo.stefka.eu/jiriks74/create-pull-request.git
synced 2025-01-18 16:01:06 +01:00
fix format and cleanup
This commit is contained in:
parent
93858f721d
commit
491f77f4d6
4 changed files with 11 additions and 23 deletions
|
@ -321,13 +321,13 @@ export async function createOrUpdateBranch(
|
|||
result.hasDiffWithBase = await isAhead(git, base, branch)
|
||||
}
|
||||
|
||||
// Build the branch commits
|
||||
result.branchCommits = await buildBranchCommits(git, base, branch)
|
||||
|
||||
// Get the base and head SHAs
|
||||
result.baseSha = await git.revParse(base)
|
||||
result.headSha = await git.revParse(branch)
|
||||
|
||||
// Build the branch commits
|
||||
result.branchCommits = await buildBranchCommits(git, base, branch)
|
||||
|
||||
// Delete the temporary branch
|
||||
await git.exec(['branch', '--delete', '--force', tempBranch])
|
||||
|
||||
|
|
|
@ -196,7 +196,7 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
|
|||
`Pushing pull request branch to '${branchRemoteName}/${inputs.branch}'`
|
||||
)
|
||||
if (inputs.signCommit) {
|
||||
// Stash any uncommitted tracked and untracked changes
|
||||
// Create signed commits via the GitHub API
|
||||
const stashed = await git.stashPush(['--include-untracked'])
|
||||
await git.checkout(inputs.branch)
|
||||
await githubHelper.pushSignedCommits(
|
||||
|
|
|
@ -201,16 +201,7 @@ export class GitHubHelper {
|
|||
branch: string
|
||||
): Promise<void> {
|
||||
let headSha = baseSha
|
||||
|
||||
// testing
|
||||
if (branchCommits.length > 0 && branchCommits[0].parents[0] !== baseSha) {
|
||||
throw new Error(
|
||||
`The base commit ${baseSha} does not match the first commit's parent ${branchCommits[0].parents[0]}`
|
||||
)
|
||||
}
|
||||
|
||||
for (const commit of branchCommits) {
|
||||
// TODO: The headSha of the previous commit should be passed and used as the parent.
|
||||
headSha = await this.createCommit(
|
||||
commit,
|
||||
[headSha],
|
||||
|
@ -270,7 +261,9 @@ export class GitHubHelper {
|
|||
core.info(
|
||||
`Created commit ${remoteCommit.sha} for local commit ${commit.sha}`
|
||||
)
|
||||
core.debug(`Commit verified: ${remoteCommit.verification.verified}; reason: ${remoteCommit.verification.reason}`)
|
||||
core.info(
|
||||
`Commit verified: ${remoteCommit.verification.verified}; reason: ${remoteCommit.verification.reason}`
|
||||
)
|
||||
return remoteCommit.sha
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue