diff --git a/dist/index.js b/dist/index.js index ea03e7c..c252284 100644 --- a/dist/index.js +++ b/dist/index.js @@ -108,8 +108,8 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(__webpack_require__(470)); -const gpg_1 = __webpack_require__(207); -const openpgp_1 = __webpack_require__(781); +const gpg = __importStar(__webpack_require__(207)); +const openpgp = __importStar(__webpack_require__(781)); const stateHelper = __importStar(__webpack_require__(153)); function run() { return __awaiter(this, void 0, void 0, function* () { @@ -118,16 +118,18 @@ function run() { core.setFailed('Signing key required'); return; } - core.debug(`SIGNING_KEY: ${process.env.SIGNING_KEY}`); - core.debug(`PASSPHRASE: ${process.env.PASSPHRASE}`); + core.info('📣 GnuPG info'); + const version = yield gpg.getVersion(); + core.info(`GnuPG version: ${version.gnupg}`); + core.info(`libgcrypt version: ${version.libgcrypt}`); core.info('🔮 Checking signing key...'); - const privateKey = yield openpgp_1.readPrivateKey(process.env.SIGNING_KEY); + const privateKey = yield openpgp.readPrivateKey(process.env.SIGNING_KEY); core.debug(`key.fingerprint=${privateKey.fingerprint}`); core.debug(`key.keyID=${privateKey.keyID}`); core.debug(`key.userID=${privateKey.userID}`); core.debug(`key.creationTime=${privateKey.creationTime}`); core.info('🔑 Importing secret key...'); - yield gpg_1.importKey(process.env.SIGNING_KEY); + yield gpg.importKey(process.env.SIGNING_KEY); } catch (error) { core.setFailed(error.message); @@ -142,8 +144,8 @@ function cleanup() { } try { core.info('🚿 Removing keys from GnuPG...'); - const privateKey = yield openpgp_1.readPrivateKey(process.env.SIGNING_KEY); - yield gpg_1.deleteKey(privateKey.fingerprint); + const privateKey = yield openpgp.readPrivateKey(process.env.SIGNING_KEY); + yield gpg.deleteKey(privateKey.fingerprint); } catch (error) { core.warning(error.message); diff --git a/src/main.ts b/src/main.ts index 3a5d0e4..239cba8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,6 @@ import * as core from '@actions/core'; -import {deleteKey, importKey} from './gpg'; -import {readPrivateKey} from './openpgp'; +import * as gpg from './gpg'; +import * as openpgp from './openpgp'; import * as stateHelper from './state-helper'; async function run(): Promise { @@ -10,18 +10,20 @@ async function run(): Promise { return; } - core.debug(`SIGNING_KEY: ${process.env.SIGNING_KEY}`); - core.debug(`PASSPHRASE: ${process.env.PASSPHRASE}`); + core.info('📣 GnuPG info'); + const version = await gpg.getVersion(); + core.info(`GnuPG version: ${version.gnupg}`); + core.info(`libgcrypt version: ${version.libgcrypt}`); core.info('🔮 Checking signing key...'); - const privateKey = await readPrivateKey(process.env.SIGNING_KEY); + const privateKey = await openpgp.readPrivateKey(process.env.SIGNING_KEY); core.debug(`key.fingerprint=${privateKey.fingerprint}`); core.debug(`key.keyID=${privateKey.keyID}`); core.debug(`key.userID=${privateKey.userID}`); core.debug(`key.creationTime=${privateKey.creationTime}`); core.info('🔑 Importing secret key...'); - await importKey(process.env.SIGNING_KEY); + await gpg.importKey(process.env.SIGNING_KEY); } catch (error) { core.setFailed(error.message); } @@ -34,8 +36,8 @@ async function cleanup(): Promise { } try { core.info('🚿 Removing keys from GnuPG...'); - const privateKey = await readPrivateKey(process.env.SIGNING_KEY); - await deleteKey(privateKey.fingerprint); + const privateKey = await openpgp.readPrivateKey(process.env.SIGNING_KEY); + await gpg.deleteKey(privateKey.fingerprint); } catch (error) { core.warning(error.message); }