mirror of
https://github.com/actions/checkout.git
synced 2026-12-05 03:52:55 +08:00
Ignore a .git suffix when matching checkout repositories
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user