Ignore a .git suffix when matching checkout repositories

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Francesco Renzi
2026-12-04 11:08:08 +01:00
co-authored by Copilot App
parent 152ac2d544
commit e3c9da6753
4 changed files with 59 additions and 6 deletions
+18
View File
@@ -378,6 +378,24 @@ describe('input-helper tests', () => {
})
})
it('verifies a pin on the workflow repository with a .git suffix', async () => {
inputs.repository = 'some-owner/some-repo.git'
inputs.ref = mergeSha
mockCompareCommits.mockResolvedValue({
data: {
base_commit: {sha: workflowSha},
merge_base_commit: {sha: ancestorSha}
}
})
await expect(inputHelper.getInputs()).rejects.toThrow(
/Refusing to check out the requested commit/
)
expect(mockCompareCommits).toHaveBeenCalledWith(
expect.objectContaining({owner: 'some-owner', repo: 'some-repo'})
)
})
it.each([
['a PR merge commit outside workflow history', workflowSha, ancestorSha],
['a comparison against an unexpected base', ancestorSha, mergeSha]