qcastel / github-actions-maven-release

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

Build failure for release as unable to read username #12

Closed viswanath7 closed 4 years ago

viswanath7 commented 4 years ago

Hello,

I tried to use the git hub action with the following configuration

     - name: Publish artifact on GitHub Packages
        run: mvn -B clean deploy -DskipTests
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Configure Git user
        run: |
          git config user.email "actions@github.com"
          git config user.name "GitHub Actions"
      - name: Make a release
        uses: qcastel/github-actions-maven-release@master
        with:
          release-branch-name: "master"
          git-release-bot-name: "release-bot"
          git-release-bot-email: "release-bot@example.com"
          access-token: ${{ secrets.GITHUB_ACCESS_TOKEN }}
          maven-args: "-Dmaven.javadoc.skip=true -DskipTests -DskipITs -Ddockerfile.skip -DdockerCompose.skip"

but it fails with a fatal error as shown below.

Do mvn release:perform with arguments -Dmaven.javadoc.skip=true -DskipTests -DskipITs -Ddockerfile.skip -DdockerCompose.skip
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------< nl.ami:sales-lead-management >--------------------
[INFO] Building sales-lead-management 1.2-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-release-plugin:2.5.3:perform (default-cli) @ sales-lead-management ---
[INFO] Checking out the project to perform the release ...
[INFO] Executing: /bin/sh -c cd /github/workspace/target && git clone --branch sales-lead-management-1.1 https://github.com/AM-i-B-V/sales-lead-management.git /github/workspace/target/checkout
[INFO] Working directory: /github/workspace/target
Error:  The git-clone command failed.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.707 s
[INFO] Finished at: 2020-10-18T19:54:10Z
[INFO] ------------------------------------------------------------------------
Error:  Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:perform (default-cli) on project sales-lead-management: Unable to checkout from SCM
Error:  Provider message:
Error:  The git-clone command failed.
Error:  Command output:
Error:  Cloning into '/github/workspace/target/checkout'...
Error:  fatal: could not read Username for 'https://github.com': No such device or address
Error:  -> [Help 1]
Error:  
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
Error:  Re-run Maven using the -X switch to enable full debug logging.
Error:  
Error:  For more information about the errors and possible solutions, please read the following articles:
Error:  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

It does make a new release though. How can one make it succeed?

Thanks a lot for your time and efforts in advance!

qcastel commented 4 years ago

Hello @viswanath7,

Today I released a new version of the github action, which I believe would be more straight forward to setup. In particular, I implemented an SSH key setup, which should avoid those kind of issues.

In your case, I think you just didn't setup the SCM correctly. See doc here: https://github.com/qcastel/github-actions-maven-release#configure-the-scm

let me know if you still face any issue with this github action