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