pass base commit to push signed commits

This commit is contained in:
Peter Evans 2024-08-23 11:10:56 +00:00
parent 42beb85339
commit 034fcb0bf3
4 changed files with 56 additions and 48 deletions

View file

@ -220,13 +220,13 @@ export class GitHubHelper {
async pushSignedCommits(
branchCommits: Commit[],
baseSha: string,
baseCommit: Commit,
repoPath: string,
branchRepository: string,
branch: string
): Promise<CommitResponse> {
let headCommit: CommitResponse = {
sha: baseSha,
sha: baseCommit.sha,
verified: false
}
for (const commit of branchCommits) {
@ -248,6 +248,7 @@ export class GitHubHelper {
branchRepository: string
): Promise<CommitResponse> {
const repository = this.parseRepository(branchRepository)
// In the case of an empty commit, the tree is the same as the parent
let treeSha = commit.tree
if (commit.changes.length > 0) {
core.info(`Creating tree objects for local commit ${commit.sha}`)