You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix gpg hanging waiting for input when more than one key is present in keychain (#5471)
Mill's artifact signing for publishing needs `gpg` to import the signing
keys. However, the current implementation naively assumes that the key
it imports is the only key.
If you have other keys in your keychain, a couple of things could
happen:
- `gpg` by default signs using the first key in your keychain, which
isn't necessarily the key you just imported, so your artifact can be
signed using the wrong key.
- If the key `gpg` picks has a passphrase, `gpg` will hang indefinitely
waiting for you to enter the passphrase to stdin, which will never
happen, as it's mill handling the stdin.
This PR ensures that when the key is imported into GPG, its ID is
extracted and then used in the signing commands to specify which key to
use.
Tested manually on Linux and Mac.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
@@ -69,7 +69,7 @@ The `mill.contrib.sonatypecentral/publishAll` method takes the following argumen
69
69
70
70
`password`: The password for calling the Sonatype Central publishing api. Defaults to the `SONATYPE_PASSWORD` environment variable if unset. If neither the parameter nor the environment variable are set, an error will be thrown. +
71
71
72
-
`gpgArgs`: Arguments to pass to the gpg package for signing artifacts. Uses the `MILL_PGP_PASSPHRASE` environment variable if set. _Default: `[--passphrase=$MILL_PGP_PASSPHRASE], --no-tty, --pinentry-mode, loopback, --batch, --yes, -a, -b`._ +
72
+
`gpgArgs`: Arguments to pass to the gpg package for signing artifacts. Uses the `MILL_PGP_PASSPHRASE` environment variable if set. _Default: `[--passphrase=$MILL_PGP_PASSPHRASE], --no-tty, --pinentry-mode, loopback, --batch, --yes, --armor, --detach-sign`._ +
73
73
74
74
`publishArtifacts`: The command for generating all publishable artifacts (ex. `__.publishArtifacts`). Required. +
Copy file name to clipboardExpand all lines: website/docs/modules/ROOT/partials/Publishing_Footer.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -261,7 +261,7 @@ The `./mill mill.javalib.SonatypeCentralPublishModule/publishAll` takes the foll
261
261
262
262
`password`: The password for calling the Sonatype Central publishing api. Defaults to the `SONATYPE_PASSWORD` environment variable if unset. If neither the parameter nor the environment variable are set, an error will be thrown. +
263
263
264
-
`gpgArgs`: Arguments to pass to the gpg package for signing artifacts. Uses the `MILL_PGP_PASSPHRASE` environment variable if set. _Default: `[--passphrase=$MILL_PGP_PASSPHRASE], --no-tty, --pinentry-mode, loopback, --batch, --yes, -a, -b`._ +
264
+
`gpgArgs`: Arguments to pass to the gpg package for signing artifacts. Uses the `MILL_PGP_PASSPHRASE` environment variable if set. _Default: `[--passphrase=$MILL_PGP_PASSPHRASE], --no-tty, --pinentry-mode, loopback, --batch, --yes, --armor, --detach-sign`._ +
265
265
266
266
`publishArtifacts`: The command for generating all publishable artifacts (ex. `__.publishArtifacts`). Required. +
0 commit comments