1
0
Fork 0
mirror of https://github.com/actions/setup-java.git synced 2024-08-16 10:19:51 +02:00
setup-java/src/cleanup-java.ts

20 lines
500 B
TypeScript
Raw Normal View History

2020-05-02 13:33:15 +02:00
import * as core from '@actions/core';
import * as gpg from './gpg';
2020-07-16 03:53:39 +02:00
import * as constants from './constants';
2020-05-02 13:33:15 +02:00
async function run() {
2020-07-16 03:53:39 +02:00
if (core.getInput(constants.INPUT_GPG_PRIVATE_KEY, {required: false})) {
core.info('removing private key from keychain');
2020-05-02 13:33:15 +02:00
try {
2020-07-16 03:53:39 +02:00
const keyFingerprint = core.getState(
constants.STATE_GPG_PRIVATE_KEY_FINGERPRINT
);
2020-05-02 13:33:15 +02:00
await gpg.deleteKey(keyFingerprint);
} catch (error) {
core.setFailed(error.message);
}
}
}
run();