mirror of
https://github.com/crazy-max/ghaction-import-gpg.git
synced 2024-11-05 21:25:50 -05:00
Delete key using primary key ID not subkey ID (#125)
This commit is contained in:
parent
2724049ae2
commit
baa427b5b4
3 changed files with 15 additions and 3 deletions
10
dist/index.js
generated
vendored
10
dist/index.js
generated
vendored
|
@ -444,6 +444,7 @@ function run() {
|
||||||
fingerprint = inputs.fingerprint;
|
fingerprint = inputs.fingerprint;
|
||||||
}
|
}
|
||||||
stateHelper.setFingerprint(fingerprint);
|
stateHelper.setFingerprint(fingerprint);
|
||||||
|
stateHelper.setKeyID(privateKey.keyID);
|
||||||
yield core.group(`Fingerprint to use`, () => __awaiter(this, void 0, void 0, function* () {
|
yield core.group(`Fingerprint to use`, () => __awaiter(this, void 0, void 0, function* () {
|
||||||
core.info(fingerprint);
|
core.info(fingerprint);
|
||||||
}));
|
}));
|
||||||
|
@ -526,7 +527,7 @@ function cleanup() {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
core.info('Removing keys');
|
core.info('Removing keys');
|
||||||
yield gpg.deleteKey(stateHelper.fingerprint);
|
yield gpg.deleteKey(stateHelper.keyId);
|
||||||
core.info('Killing GnuPG agent');
|
core.info('Killing GnuPG agent');
|
||||||
yield gpg.killAgent();
|
yield gpg.killAgent();
|
||||||
}
|
}
|
||||||
|
@ -644,14 +645,19 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.setFingerprint = exports.fingerprint = exports.IsPost = void 0;
|
exports.setKeyID = exports.setFingerprint = exports.keyId = exports.fingerprint = exports.IsPost = void 0;
|
||||||
const core = __importStar(__webpack_require__(2186));
|
const core = __importStar(__webpack_require__(2186));
|
||||||
exports.IsPost = !!process.env['STATE_isPost'];
|
exports.IsPost = !!process.env['STATE_isPost'];
|
||||||
exports.fingerprint = process.env['STATE_fingerprint'] || '';
|
exports.fingerprint = process.env['STATE_fingerprint'] || '';
|
||||||
|
exports.keyId = process.env['STATE_keyId'] || '';
|
||||||
function setFingerprint(fingerprint) {
|
function setFingerprint(fingerprint) {
|
||||||
core.saveState('fingerprint', fingerprint);
|
core.saveState('fingerprint', fingerprint);
|
||||||
}
|
}
|
||||||
exports.setFingerprint = setFingerprint;
|
exports.setFingerprint = setFingerprint;
|
||||||
|
function setKeyID(keyID) {
|
||||||
|
core.saveState('keyId', keyID);
|
||||||
|
}
|
||||||
|
exports.setKeyID = setKeyID;
|
||||||
if (!exports.IsPost) {
|
if (!exports.IsPost) {
|
||||||
core.saveState('isPost', 'true');
|
core.saveState('isPost', 'true');
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ async function run(): Promise<void> {
|
||||||
fingerprint = inputs.fingerprint;
|
fingerprint = inputs.fingerprint;
|
||||||
}
|
}
|
||||||
stateHelper.setFingerprint(fingerprint);
|
stateHelper.setFingerprint(fingerprint);
|
||||||
|
stateHelper.setKeyID(privateKey.keyID);
|
||||||
await core.group(`Fingerprint to use`, async () => {
|
await core.group(`Fingerprint to use`, async () => {
|
||||||
core.info(fingerprint);
|
core.info(fingerprint);
|
||||||
});
|
});
|
||||||
|
@ -131,7 +132,7 @@ async function cleanup(): Promise<void> {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
core.info('Removing keys');
|
core.info('Removing keys');
|
||||||
await gpg.deleteKey(stateHelper.fingerprint);
|
await gpg.deleteKey(stateHelper.keyId);
|
||||||
|
|
||||||
core.info('Killing GnuPG agent');
|
core.info('Killing GnuPG agent');
|
||||||
await gpg.killAgent();
|
await gpg.killAgent();
|
||||||
|
|
|
@ -2,11 +2,16 @@ import * as core from '@actions/core';
|
||||||
|
|
||||||
export const IsPost = !!process.env['STATE_isPost'];
|
export const IsPost = !!process.env['STATE_isPost'];
|
||||||
export const fingerprint = process.env['STATE_fingerprint'] || '';
|
export const fingerprint = process.env['STATE_fingerprint'] || '';
|
||||||
|
export const keyId = process.env['STATE_keyId'] || '';
|
||||||
|
|
||||||
export function setFingerprint(fingerprint: string) {
|
export function setFingerprint(fingerprint: string) {
|
||||||
core.saveState('fingerprint', fingerprint);
|
core.saveState('fingerprint', fingerprint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function setKeyID(keyID: string) {
|
||||||
|
core.saveState('keyId', keyID);
|
||||||
|
}
|
||||||
|
|
||||||
if (!IsPost) {
|
if (!IsPost) {
|
||||||
core.saveState('isPost', 'true');
|
core.saveState('isPost', 'true');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue