fix format and cleanup

This commit is contained in:
Peter Evans 2024-08-09 13:04:15 +00:00
parent 4c77294175
commit 384bd7f976
4 changed files with 11 additions and 23 deletions

View file

@ -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
}