Skip to content

Not able to Import private gpg key #548

Description

@yvasyliev

Description:
I'm using GitHub Actions to publish artifacts on Maven Central.
One of the required steps is to provide gpg signature.

actions/setup-java@v3 action fails on Importing private gpg key step.
The error is The process '/usr/bin/gpg' failed with exit code 2.

I provide gpg-private-key as following:

-----BEGIN PGP PRIVATE KEY BLOCK-----

{SECRET_KEY}
-----END PGP PRIVATE KEY BLOCK-----

It used to work a few months ago....
Could you please help me to understand what is wrong?

Task version:
actions/setup-java@v3

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:

Expected behavior:
Set up JDK 8 step should pass.

Actual behavior:
Set up JDK 8 step fails.
Log:

Run actions/setup-java@v3
  with:
    java-version: 8
    distribution: adopt
    cache: maven
    server-id: ossrh
    server-username: MAVEN_USERNAME
    server-password: MAVEN_PASSWORD
    gpg-private-key: ***
    gpg-passphrase: MAVEN_GPG_PASSPHRASE
    java-package: jdk
    check-latest: false
    overwrite-settings: true
    job-status: success
    token: ***
  env:
    TAG: v2.1.2
    JAR_NAME: deezer-api-2.1.2-jar-with-dependencies.jar
    JAR_PATH: target/deezer-api-2.1.2-jar-with-dependencies.jar
Installed distributions
  Trying to resolve the latest version from remote
  Resolved latest version as 8.0.382+5
  Trying to download...
  Downloading Java 8.0.382+5 (Adopt-Hotspot) from https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u382-b05/OpenJDK8U-jdk_x64_linux_hotspot_8u382b05.tar.gz ...
  Extracting Java archive...
  /usr/bin/tar xz --warning=no-unknown-keyword -C /home/runner/work/_temp/ca7fd9c3-7e35-4b79-9fea-a6828e676ef9 -f /home/runner/work/_temp/d87a81ee-9087-49dd-85f4-1b9abfba2fde
  Java 8.0.382+5 was downloaded
  Setting Java 8.0.382+5 as the default
  Creating toolchains.xml for JDK version 8 from adopt
  Writing to /home/runner/.m2/toolchains.xml
  
  Java configuration:
    Distribution: adopt
    Version: 8.0.382+5
    Path: /opt/hostedtoolcache/Java_Adopt_jdk/8.0.382-5/x64
  
Creating settings.xml with server-id: ossrh
Writing to /home/runner/.m2/settings.xml
Importing private gpg key
Error: The process '/usr/bin/gpg' failed with exit code 2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions