mirror of
https://github.com/actions/setup-java.git
synced 2024-11-27 03:59:02 +00:00
cleanup: Use --delete-secret-and-public-key to delete GPG_PRIVATE_KEY (#226)
This deletes the secret key(s) and public keys(s) for the fingerprint of the installed GPG_PRIVATE_KEY. If the installed GPG_PRIVATE_KEY only contains a signing subkey without the primary private key, the --delete-secret-and-public-key will successfully delete the keys. Signed-off-by: BJ Hargrave <bj@hargrave.dev>
This commit is contained in:
parent
61c179a6ef
commit
d34438b137
3
dist/cleanup/index.js
vendored
3
dist/cleanup/index.js
vendored
@ -63237,10 +63237,9 @@ function importKey(privateKey) {
|
|||||||
exports.importKey = importKey;
|
exports.importKey = importKey;
|
||||||
function deleteKey(keyFingerprint) {
|
function deleteKey(keyFingerprint) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
yield exec.exec('gpg', ['--batch', '--yes', '--delete-secret-keys', keyFingerprint], {
|
yield exec.exec('gpg', ['--batch', '--yes', '--delete-secret-and-public-key', keyFingerprint], {
|
||||||
silent: true
|
silent: true
|
||||||
});
|
});
|
||||||
yield exec.exec('gpg', ['--batch', '--yes', '--delete-keys', keyFingerprint], { silent: true });
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.deleteKey = deleteKey;
|
exports.deleteKey = deleteKey;
|
||||||
|
3
dist/setup/index.js
vendored
3
dist/setup/index.js
vendored
@ -94689,10 +94689,9 @@ function importKey(privateKey) {
|
|||||||
exports.importKey = importKey;
|
exports.importKey = importKey;
|
||||||
function deleteKey(keyFingerprint) {
|
function deleteKey(keyFingerprint) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
yield exec.exec('gpg', ['--batch', '--yes', '--delete-secret-keys', keyFingerprint], {
|
yield exec.exec('gpg', ['--batch', '--yes', '--delete-secret-and-public-key', keyFingerprint], {
|
||||||
silent: true
|
silent: true
|
||||||
});
|
});
|
||||||
yield exec.exec('gpg', ['--batch', '--yes', '--delete-keys', keyFingerprint], { silent: true });
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.deleteKey = deleteKey;
|
exports.deleteKey = deleteKey;
|
||||||
|
@ -39,8 +39,7 @@ export async function importKey(privateKey: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteKey(keyFingerprint: string) {
|
export async function deleteKey(keyFingerprint: string) {
|
||||||
await exec.exec('gpg', ['--batch', '--yes', '--delete-secret-keys', keyFingerprint], {
|
await exec.exec('gpg', ['--batch', '--yes', '--delete-secret-and-public-key', keyFingerprint], {
|
||||||
silent: true
|
silent: true
|
||||||
});
|
});
|
||||||
await exec.exec('gpg', ['--batch', '--yes', '--delete-keys', keyFingerprint], { silent: true });
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user