mirror of
https://github.com/crazy-max/ghaction-import-gpg.git
synced 2024-12-25 20:52:06 -05:00
Cleanup
This commit is contained in:
parent
df2c9793f5
commit
aae088b80a
2 changed files with 12 additions and 16 deletions
14
dist/index.js
generated
vendored
14
dist/index.js
generated
vendored
|
@ -1018,7 +1018,6 @@ const core = __importStar(__webpack_require__(470));
|
||||||
const gpg = __importStar(__webpack_require__(207));
|
const gpg = __importStar(__webpack_require__(207));
|
||||||
const openpgp = __importStar(__webpack_require__(781));
|
const openpgp = __importStar(__webpack_require__(781));
|
||||||
const stateHelper = __importStar(__webpack_require__(153));
|
const stateHelper = __importStar(__webpack_require__(153));
|
||||||
const exec = __importStar(__webpack_require__(986));
|
|
||||||
const os_1 = __importDefault(__webpack_require__(87));
|
const os_1 = __importDefault(__webpack_require__(87));
|
||||||
function run() {
|
function run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
@ -1032,7 +1031,6 @@ function run() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
core.info('📣 GnuPG info');
|
core.info('📣 GnuPG info');
|
||||||
yield exec.exec('which', ['gpg']);
|
|
||||||
const version = yield gpg.getVersion();
|
const version = yield gpg.getVersion();
|
||||||
const dirs = yield gpg.getDirs();
|
const dirs = yield gpg.getDirs();
|
||||||
core.info(`Version : ${version.gnupg} (libgcrypt ${version.libgcrypt})`);
|
core.info(`Version : ${version.gnupg} (libgcrypt ${version.libgcrypt})`);
|
||||||
|
@ -1040,23 +1038,23 @@ function run() {
|
||||||
core.info(`Libexecdir : ${dirs.libexecdir}`);
|
core.info(`Libexecdir : ${dirs.libexecdir}`);
|
||||||
core.info(`Datadir : ${dirs.datadir}`);
|
core.info(`Datadir : ${dirs.datadir}`);
|
||||||
core.info(`Homedir : ${dirs.homedir}`);
|
core.info(`Homedir : ${dirs.homedir}`);
|
||||||
core.info('🔮 Checking signing key...');
|
core.info('🔮 Checking signing key');
|
||||||
const privateKey = yield openpgp.readPrivateKey(process.env.SIGNING_KEY);
|
const privateKey = yield openpgp.readPrivateKey(process.env.SIGNING_KEY);
|
||||||
core.debug(`Fingerprint : ${privateKey.fingerprint}`);
|
core.debug(`Fingerprint : ${privateKey.fingerprint}`);
|
||||||
core.debug(`KeyID : ${privateKey.keyID}`);
|
core.debug(`KeyID : ${privateKey.keyID}`);
|
||||||
core.debug(`UserID : ${privateKey.userID}`);
|
core.debug(`UserID : ${privateKey.userID}`);
|
||||||
core.debug(`CreationTime : ${privateKey.creationTime}`);
|
core.debug(`CreationTime : ${privateKey.creationTime}`);
|
||||||
core.info('🔑 Importing secret key...');
|
core.info('🔑 Importing secret key');
|
||||||
yield gpg.importKey(process.env.SIGNING_KEY).then(stdout => {
|
yield gpg.importKey(process.env.SIGNING_KEY).then(stdout => {
|
||||||
core.debug(stdout);
|
core.debug(stdout);
|
||||||
});
|
});
|
||||||
if (process.env.PASSPHRASE) {
|
if (process.env.PASSPHRASE) {
|
||||||
core.info('⚙️ Configuring GnuPG agent...');
|
core.info('⚙️ Configuring GnuPG agent');
|
||||||
yield gpg.configureAgent(gpg.agentConfig);
|
yield gpg.configureAgent(gpg.agentConfig);
|
||||||
core.info('📌 Getting keygrip...');
|
core.info('📌 Getting keygrip');
|
||||||
const keygrip = yield gpg.getKeygrip(privateKey.fingerprint);
|
const keygrip = yield gpg.getKeygrip(privateKey.fingerprint);
|
||||||
core.debug(`${keygrip}`);
|
core.debug(`${keygrip}`);
|
||||||
core.info('🔓 Preset passphrase...');
|
core.info('🔓 Preset passphrase');
|
||||||
yield gpg.presetPassphrase(keygrip, process.env.PASSPHRASE).then(stdout => {
|
yield gpg.presetPassphrase(keygrip, process.env.PASSPHRASE).then(stdout => {
|
||||||
core.debug(stdout);
|
core.debug(stdout);
|
||||||
});
|
});
|
||||||
|
@ -1074,7 +1072,7 @@ function cleanup() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
core.info('🚿 Removing keys...');
|
core.info('🚿 Removing keys');
|
||||||
const privateKey = yield openpgp.readPrivateKey(process.env.SIGNING_KEY);
|
const privateKey = yield openpgp.readPrivateKey(process.env.SIGNING_KEY);
|
||||||
yield gpg.deleteKey(privateKey.fingerprint);
|
yield gpg.deleteKey(privateKey.fingerprint);
|
||||||
}
|
}
|
||||||
|
|
14
src/main.ts
14
src/main.ts
|
@ -2,7 +2,6 @@ import * as core from '@actions/core';
|
||||||
import * as gpg from './gpg';
|
import * as gpg from './gpg';
|
||||||
import * as openpgp from './openpgp';
|
import * as openpgp from './openpgp';
|
||||||
import * as stateHelper from './state-helper';
|
import * as stateHelper from './state-helper';
|
||||||
import * as exec from '@actions/exec';
|
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
|
|
||||||
async function run(): Promise<void> {
|
async function run(): Promise<void> {
|
||||||
|
@ -18,7 +17,6 @@ async function run(): Promise<void> {
|
||||||
}
|
}
|
||||||
|
|
||||||
core.info('📣 GnuPG info');
|
core.info('📣 GnuPG info');
|
||||||
await exec.exec('which', ['gpg']);
|
|
||||||
const version = await gpg.getVersion();
|
const version = await gpg.getVersion();
|
||||||
const dirs = await gpg.getDirs();
|
const dirs = await gpg.getDirs();
|
||||||
core.info(`Version : ${version.gnupg} (libgcrypt ${version.libgcrypt})`);
|
core.info(`Version : ${version.gnupg} (libgcrypt ${version.libgcrypt})`);
|
||||||
|
@ -27,27 +25,27 @@ async function run(): Promise<void> {
|
||||||
core.info(`Datadir : ${dirs.datadir}`);
|
core.info(`Datadir : ${dirs.datadir}`);
|
||||||
core.info(`Homedir : ${dirs.homedir}`);
|
core.info(`Homedir : ${dirs.homedir}`);
|
||||||
|
|
||||||
core.info('🔮 Checking signing key...');
|
core.info('🔮 Checking signing key');
|
||||||
const privateKey = await openpgp.readPrivateKey(process.env.SIGNING_KEY);
|
const privateKey = await openpgp.readPrivateKey(process.env.SIGNING_KEY);
|
||||||
core.debug(`Fingerprint : ${privateKey.fingerprint}`);
|
core.debug(`Fingerprint : ${privateKey.fingerprint}`);
|
||||||
core.debug(`KeyID : ${privateKey.keyID}`);
|
core.debug(`KeyID : ${privateKey.keyID}`);
|
||||||
core.debug(`UserID : ${privateKey.userID}`);
|
core.debug(`UserID : ${privateKey.userID}`);
|
||||||
core.debug(`CreationTime : ${privateKey.creationTime}`);
|
core.debug(`CreationTime : ${privateKey.creationTime}`);
|
||||||
|
|
||||||
core.info('🔑 Importing secret key...');
|
core.info('🔑 Importing secret key');
|
||||||
await gpg.importKey(process.env.SIGNING_KEY).then(stdout => {
|
await gpg.importKey(process.env.SIGNING_KEY).then(stdout => {
|
||||||
core.debug(stdout);
|
core.debug(stdout);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (process.env.PASSPHRASE) {
|
if (process.env.PASSPHRASE) {
|
||||||
core.info('⚙️ Configuring GnuPG agent...');
|
core.info('⚙️ Configuring GnuPG agent');
|
||||||
await gpg.configureAgent(gpg.agentConfig);
|
await gpg.configureAgent(gpg.agentConfig);
|
||||||
|
|
||||||
core.info('📌 Getting keygrip...');
|
core.info('📌 Getting keygrip');
|
||||||
const keygrip = await gpg.getKeygrip(privateKey.fingerprint);
|
const keygrip = await gpg.getKeygrip(privateKey.fingerprint);
|
||||||
core.debug(`${keygrip}`);
|
core.debug(`${keygrip}`);
|
||||||
|
|
||||||
core.info('🔓 Preset passphrase...');
|
core.info('🔓 Preset passphrase');
|
||||||
await gpg.presetPassphrase(keygrip, process.env.PASSPHRASE).then(stdout => {
|
await gpg.presetPassphrase(keygrip, process.env.PASSPHRASE).then(stdout => {
|
||||||
core.debug(stdout);
|
core.debug(stdout);
|
||||||
});
|
});
|
||||||
|
@ -63,7 +61,7 @@ async function cleanup(): Promise<void> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
core.info('🚿 Removing keys...');
|
core.info('🚿 Removing keys');
|
||||||
const privateKey = await openpgp.readPrivateKey(process.env.SIGNING_KEY);
|
const privateKey = await openpgp.readPrivateKey(process.env.SIGNING_KEY);
|
||||||
await gpg.deleteKey(privateKey.fingerprint);
|
await gpg.deleteKey(privateKey.fingerprint);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
Loading…
Reference in a new issue