mirror of
https://github.com/actions/setup-java.git
synced 2026-09-04 09:59:33 +00:00
Fix alpine failures by switching default back to only warn on verification failures. To prevent build failures due to missing GPG or rotated vendor keys. (#1262)
Also allow multiple GPG keys to be provided. Co-authored-by: John <1615532+johnoliver@users.noreply.github.com>
This commit is contained in:
+28
-1
@@ -245,7 +245,7 @@ describe('gpg tests', () => {
|
||||
expect.any(String),
|
||||
'--batch',
|
||||
'--import',
|
||||
expect.stringContaining('public-key.asc')
|
||||
expect.stringContaining('public-key-0.asc')
|
||||
],
|
||||
expect.objectContaining({silent: true})
|
||||
);
|
||||
@@ -263,5 +263,32 @@ describe('gpg tests', () => {
|
||||
expect.objectContaining({silent: true})
|
||||
);
|
||||
});
|
||||
|
||||
it('imports multiple bundled keys before verifying the package', async () => {
|
||||
(tc.downloadTool as jest.Mock<any>).mockResolvedValue(
|
||||
'/tmp/jdk.tar.gz.sig'
|
||||
);
|
||||
|
||||
await gpg.verifyPackageSignature(
|
||||
'/tmp/jdk.tar.gz',
|
||||
'https://example.com/jdk.tar.gz.sig',
|
||||
['public-key-a', 'public-key-b']
|
||||
);
|
||||
|
||||
expect(exec.exec).toHaveBeenNthCalledWith(
|
||||
1,
|
||||
'gpg',
|
||||
[
|
||||
'--homedir',
|
||||
expect.any(String),
|
||||
'--batch',
|
||||
'--import',
|
||||
expect.stringContaining('public-key-0.asc'),
|
||||
expect.stringContaining('public-key-1.asc')
|
||||
],
|
||||
expect.objectContaining({silent: true})
|
||||
);
|
||||
expect(exec.exec).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user