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:
Bruno Borges
2026-09-03 13:27:24 -04:00
committed by GitHub
parent 4889c4aff5
commit 0781fc6af3
27 changed files with 575 additions and 136 deletions
+28 -1
View File
@@ -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);
});
});
});