Repository navigation
Added support for GPG signing #63
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
Changes from 1 commit
d94db22
e494666
01f4422
7f23828
91d1667
034b7a7
2d0e474
4d8dc69
012c21e
36bb906
ac9630f
38e0c8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,14 @@ | ||
| import * as core from '@actions/core'; | ||
| import * as gpg from './gpg'; | ||
| import * as constants from './constants'; | ||
|
|
||
| async function run() { | ||
| if (core.getInput('gpg-private-key', {required: false})) { | ||
| console.log('removing private key from keychain'); | ||
| if (core.getInput(constants.INPUT_GPG_PRIVATE_KEY, {required: false})) { | ||
| core.info('removing private key from keychain'); | ||
| try { | ||
| const keyFingerprint = core.getState('gpg-private-key-fingerprint'); | ||
| const keyFingerprint = core.getState( | ||
| constants.STATE_GPG_PRIVATE_KEY_FINGERPRINT | ||
| ); | ||
| await gpg.deleteKey(keyFingerprint); | ||
| } catch (error) { | ||
| core.setFailed(error.message); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What could be the error message here? If we fail to clean up, should we surface that as an actionable item to end user so that they can manually clean it up (relevant to self-hosted runners)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just going to output whatever we get from running the failed GPG command. So for example if it failed to find the key for whatever reason, it's going to tell us Or if it failed, it would just be whatever I can try to simulate what that might look like a little more concretely tonight if I push up a bad cleanup change.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be safer to just say "failed to delete key" rather than the actual GPG output so that we don't leak anything accidentally. If this fails on a hosted runner, they could run the delete command themselves to get a better understanding of what exactly went wrong. I think I'll go down that route instead. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| export const INPUT_VERSION = 'version'; | ||
| export const INPUT_JAVA_VERSION = 'java-version'; | ||
| export const INPUT_ARCHITECTURE = 'architecture'; | ||
| export const INPUT_JAVA_PACKAGE = 'java-package'; | ||
| export const INPUT_JDK_FILE = 'jdkFile'; | ||
| export const INPUT_SERVER_ID = 'server-id'; | ||
| export const INPUT_SERVER_USERNAME = 'server-username'; | ||
| export const INPUT_SERVER_PASSWORD = 'server-password'; | ||
| export const INPUT_GPG_PRIVATE_KEY = 'gpg-private-key'; | ||
| export const INPUT_GPG_PASSPHRASE = 'gpg-passphrase'; | ||
|
|
||
| export const INPUT_DEFAULT_GPG_PASSPHRASE = 'GPG_PASSPHRASE'; | ||
|
|
||
| export const STATE_GPG_PRIVATE_KEY_FINGERPRINT = 'gpg-private-key-fingerprint'; |
Uh oh!
There was an error while loading. Please reload this page.