qcastel / github-actions-maven-release

Release your Java application and publish artifacts
129 stars 38 forks source link

Host key verification failed with GITHUB_TOKEN #13

Closed BernhardFuchs closed 4 years ago

BernhardFuchs commented 4 years ago

I try to use the GITHUB_TOKEN as described in the official docs but get following error:

Error:  Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project did-common-java: Unable to commit files
Error:  Provider message:
Error:  The git-push command failed.
Error:  Command output:
Error:  Host key verification failed.
Error:  fatal: Could not read from remote repository.

Is use the action like this:

- name: Run maven release action
        uses: qcastel/github-actions-maven-release@master
        with:
          release-branch-name: ${{ env.RELEASE_BRANCH }}
          git-release-bot-name: "Release Workflow"
          git-release-bot-email: "some@email.com"

          access-token: ${{ secrets.GITHUB_TOKEN }}

          maven-repo-server-id: internal-maven-server-id
          maven-repo-server-username: ${{ secrets.MAVEN_USERNAME }}
          maven-repo-server-password: ${{ secrets.MAVEN_PASSWORD }}

          maven-args: "-DreleaseVersion=0.2.0 -DdevelopmentVersion=0.2.1-SNAPSHOT -Dtag=v0.2.0"
laurentleseigneur commented 4 years ago

hi all,

I have the same issue.

my scmsection in pom contains the git repo url

<developerConnection>scm:git:git@github.com:laurentleseigneur/bonita-connector-pdf-stamp.git</developerConnection>

in https://github.com/qcastel/github-actions-maven-release/blob/master/release.sh#L64 and https://github.com/qcastel/github-actions-maven-release/blob/master/release.sh#L75

what is not clear for me this usage of the github token -Dusername=$GITHUB_ACCESS_TOKEN

thanks for your help

qcastel commented 4 years ago

The -Dusername=$GITHUB_ACCESS_TOKEN is for the authentication. At the moment, it's not via SSH yet.

Although I am revisiting this github action today and will hence it with the possibility to add a SSH key instead, which personally I found easier to setup.

laurentleseigneur commented 4 years ago

thanks for your answer Quentin.

I'll give a try to https in my developper connection using current version

qcastel commented 4 years ago

@laurentleseigneur I am actually working on a new version of the github actions which should allow SSH. If you are not in the hurry, you can just wait I finish this new version of the github action :)

qcastel commented 4 years ago

@laurentleseigneur @BernhardFuchs I released a new version of this github actions which I believe should be easier to setup.

I recommend you switch to use an SSH key. I find it more straight forward, maybe because I am used to setup SSH keys for git. The documentation is here: https://github.com/qcastel/github-actions-maven-release#setup-with-ssh

If you got any problem, feel free to re-open that issue.

dbelob commented 4 years ago

If you got any problem, feel free to re-open that issue.

Yes, I got problem. New issue #14 created.