check verification status of head commit when not known

This commit is contained in:
Peter Evans 2024-08-17 22:01:12 +00:00
parent 32e97fc746
commit 1cd6df66ac
5 changed files with 77 additions and 16 deletions

View file

@ -295,6 +295,21 @@ export class GitHubHelper {
}
}
async getCommit(
sha: string,
branchRepository: string
): Promise<CommitResponse> {
const repository = this.parseRepository(branchRepository)
const {data: remoteCommit} = await this.octokit.rest.git.getCommit({
...repository,
commit_sha: sha
})
return {
sha: remoteCommit.sha,
verified: remoteCommit.verification.verified
}
}
private async createOrUpdateRef(
branchRepository: string,
branch: string,