Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete key using the primary key ID not the subkey ID #125

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/main.ts
Expand Up @@ -38,6 +38,7 @@ async function run(): Promise<void> {
fingerprint = inputs.fingerprint;
}
stateHelper.setFingerprint(fingerprint);
stateHelper.setKeyID(privateKey.keyID);
await core.group(`Fingerprint to use`, async () => {
core.info(fingerprint);
});
Expand Down Expand Up @@ -131,7 +132,7 @@ async function cleanup(): Promise<void> {
}
try {
core.info('Removing keys');
await gpg.deleteKey(stateHelper.fingerprint);
await gpg.deleteKey(stateHelper.keyId);

core.info('Killing GnuPG agent');
await gpg.killAgent();
Expand Down
5 changes: 5 additions & 0 deletions src/state-helper.ts
Expand Up @@ -2,11 +2,16 @@ import * as core from '@actions/core';

export const IsPost = !!process.env['STATE_isPost'];
export const fingerprint = process.env['STATE_fingerprint'] || '';
export const keyId = process.env['STATE_keyId'] || '';

export function setFingerprint(fingerprint: string) {
core.saveState('fingerprint', fingerprint);
}

export function setKeyID(keyID: string) {
core.saveState('keyId', keyID);
}

if (!IsPost) {
core.saveState('isPost', 'true');
}