mirror of
https://gitea.com/actions/setup-java.git
synced 2026-09-29 11:45:24 +08:00
Stop GPG agent before verification home cleanup
Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d7e7717fa7
commit
cdb3217694
Vendored
+6
-2
@@ -35832,13 +35832,16 @@ async function removeGpgHome(gpgHome) {
|
||||
if (!external_fs_.existsSync(resolvedGpgHome)) {
|
||||
return;
|
||||
}
|
||||
await stopGpgAgent(resolvedGpgHome);
|
||||
await lib_io/* rmRF */.Yz(resolvedGpgHome);
|
||||
}
|
||||
async function stopGpgAgent(gpgHome) {
|
||||
try {
|
||||
await lib_exec/* exec */.m('gpgconf', ['--homedir', toGpgPath(resolvedGpgHome), '--kill', 'gpg-agent'], { silent: true, ignoreReturnCode: true });
|
||||
await lib_exec/* exec */.m('gpgconf', ['--homedir', toGpgPath(gpgHome), '--kill', 'gpg-agent'], { silent: true, ignoreReturnCode: true });
|
||||
}
|
||||
catch {
|
||||
// gpgconf may be unavailable, but directory removal must still be attempted.
|
||||
}
|
||||
await lib_io/* rmRF */.Yz(resolvedGpgHome);
|
||||
}
|
||||
async function verifyPackageSignature(archivePath, signatureUrl, publicKeyContent) {
|
||||
const signaturePath = await tc.downloadTool(signatureUrl);
|
||||
@@ -35884,6 +35887,7 @@ async function verifyPackageSignature(archivePath, signatureUrl, publicKeyConten
|
||||
], options);
|
||||
}
|
||||
finally {
|
||||
await stopGpgAgent(gpgHome);
|
||||
await io.rmRF(signaturePath);
|
||||
await io.rmRF(gpgHome);
|
||||
}
|
||||
|
||||
Vendored
+6
-2
@@ -263,13 +263,16 @@ async function removeGpgHome(gpgHome) {
|
||||
if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(resolvedGpgHome)) {
|
||||
return;
|
||||
}
|
||||
await stopGpgAgent(resolvedGpgHome);
|
||||
await _actions_io__WEBPACK_IMPORTED_MODULE_3__/* .rmRF */ .Yz(resolvedGpgHome);
|
||||
}
|
||||
async function stopGpgAgent(gpgHome) {
|
||||
try {
|
||||
await _actions_exec__WEBPACK_IMPORTED_MODULE_4__/* .exec */ .m('gpgconf', ['--homedir', toGpgPath(resolvedGpgHome), '--kill', 'gpg-agent'], { silent: true, ignoreReturnCode: true });
|
||||
await _actions_exec__WEBPACK_IMPORTED_MODULE_4__/* .exec */ .m('gpgconf', ['--homedir', toGpgPath(gpgHome), '--kill', 'gpg-agent'], { silent: true, ignoreReturnCode: true });
|
||||
}
|
||||
catch {
|
||||
// gpgconf may be unavailable, but directory removal must still be attempted.
|
||||
}
|
||||
await _actions_io__WEBPACK_IMPORTED_MODULE_3__/* .rmRF */ .Yz(resolvedGpgHome);
|
||||
}
|
||||
async function verifyPackageSignature(archivePath, signatureUrl, publicKeyContent) {
|
||||
const signaturePath = await _actions_tool_cache__WEBPACK_IMPORTED_MODULE_5__/* .downloadTool */ .bq(signatureUrl);
|
||||
@@ -315,6 +318,7 @@ async function verifyPackageSignature(archivePath, signatureUrl, publicKeyConten
|
||||
], options);
|
||||
}
|
||||
finally {
|
||||
await stopGpgAgent(gpgHome);
|
||||
await _actions_io__WEBPACK_IMPORTED_MODULE_3__/* .rmRF */ .Yz(signaturePath);
|
||||
await _actions_io__WEBPACK_IMPORTED_MODULE_3__/* .rmRF */ .Yz(gpgHome);
|
||||
}
|
||||
|
||||
Vendored
+6
-2
@@ -375,13 +375,16 @@ async function removeGpgHome(gpgHome) {
|
||||
if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(resolvedGpgHome)) {
|
||||
return;
|
||||
}
|
||||
await stopGpgAgent(resolvedGpgHome);
|
||||
await _actions_io__WEBPACK_IMPORTED_MODULE_3__/* .rmRF */ .Yz(resolvedGpgHome);
|
||||
}
|
||||
async function stopGpgAgent(gpgHome) {
|
||||
try {
|
||||
await _actions_exec__WEBPACK_IMPORTED_MODULE_4__/* .exec */ .m('gpgconf', ['--homedir', toGpgPath(resolvedGpgHome), '--kill', 'gpg-agent'], { silent: true, ignoreReturnCode: true });
|
||||
await _actions_exec__WEBPACK_IMPORTED_MODULE_4__/* .exec */ .m('gpgconf', ['--homedir', toGpgPath(gpgHome), '--kill', 'gpg-agent'], { silent: true, ignoreReturnCode: true });
|
||||
}
|
||||
catch {
|
||||
// gpgconf may be unavailable, but directory removal must still be attempted.
|
||||
}
|
||||
await _actions_io__WEBPACK_IMPORTED_MODULE_3__/* .rmRF */ .Yz(resolvedGpgHome);
|
||||
}
|
||||
async function verifyPackageSignature(archivePath, signatureUrl, publicKeyContent) {
|
||||
const signaturePath = await _actions_tool_cache__WEBPACK_IMPORTED_MODULE_5__/* .downloadTool */ .bq(signatureUrl);
|
||||
@@ -427,6 +430,7 @@ async function verifyPackageSignature(archivePath, signatureUrl, publicKeyConten
|
||||
], options);
|
||||
}
|
||||
finally {
|
||||
await stopGpgAgent(gpgHome);
|
||||
await _actions_io__WEBPACK_IMPORTED_MODULE_3__/* .rmRF */ .Yz(signaturePath);
|
||||
await _actions_io__WEBPACK_IMPORTED_MODULE_3__/* .rmRF */ .Yz(gpgHome);
|
||||
}
|
||||
|
||||
Vendored
+6
-2
@@ -350,13 +350,16 @@ async function removeGpgHome(gpgHome) {
|
||||
if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(resolvedGpgHome)) {
|
||||
return;
|
||||
}
|
||||
await stopGpgAgent(resolvedGpgHome);
|
||||
await _actions_io__WEBPACK_IMPORTED_MODULE_3__/* .rmRF */ .Yz(resolvedGpgHome);
|
||||
}
|
||||
async function stopGpgAgent(gpgHome) {
|
||||
try {
|
||||
await _actions_exec__WEBPACK_IMPORTED_MODULE_4__/* .exec */ .m('gpgconf', ['--homedir', toGpgPath(resolvedGpgHome), '--kill', 'gpg-agent'], { silent: true, ignoreReturnCode: true });
|
||||
await _actions_exec__WEBPACK_IMPORTED_MODULE_4__/* .exec */ .m('gpgconf', ['--homedir', toGpgPath(gpgHome), '--kill', 'gpg-agent'], { silent: true, ignoreReturnCode: true });
|
||||
}
|
||||
catch {
|
||||
// gpgconf may be unavailable, but directory removal must still be attempted.
|
||||
}
|
||||
await _actions_io__WEBPACK_IMPORTED_MODULE_3__/* .rmRF */ .Yz(resolvedGpgHome);
|
||||
}
|
||||
async function verifyPackageSignature(archivePath, signatureUrl, publicKeyContent) {
|
||||
const signaturePath = await _actions_tool_cache__WEBPACK_IMPORTED_MODULE_5__/* .downloadTool */ .bq(signatureUrl);
|
||||
@@ -402,6 +405,7 @@ async function verifyPackageSignature(archivePath, signatureUrl, publicKeyConten
|
||||
], options);
|
||||
}
|
||||
finally {
|
||||
await stopGpgAgent(gpgHome);
|
||||
await _actions_io__WEBPACK_IMPORTED_MODULE_3__/* .rmRF */ .Yz(signaturePath);
|
||||
await _actions_io__WEBPACK_IMPORTED_MODULE_3__/* .rmRF */ .Yz(gpgHome);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user