Skip to content
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

Can't commit when using 's4u/setup-maven-action' #68

Open
abelsromero opened this issue Jan 21, 2024 · 4 comments
Open

Can't commit when using 's4u/setup-maven-action' #68

abelsromero opened this issue Jan 21, 2024 · 4 comments

Comments

@abelsromero
Copy link

Describe the bug
Using the action breaks Git configuration preventing committing/pushing with the TOKEN user.

To Reproduce
Trying to automate a maven deployment with maven-release-plugin, this fails with the error below.

      - uses: s4u/[email protected]
        with:
          java-distribution: 'temurin'
          java-version: ${{ matrix.java }}
          maven-version: ${{ matrix.maven }}
          settings-servers: |
            [{
              "id": "ossrh",
              "username": "${{ secrets.OSS_SONATYPE_USERNAME }}",
              "password": "${{ secrets.OSS_SONATYPE_PASSWORD }}"
            }]
Failed to execute goal org.apache.maven.plugins:maven-release-plugin:3.0.1:prepare (default-cli) on project asciidoctor-maven-tools: Unable to commit files
Error:  Provider message:
Error:  The git-push command failed.
Error:  Command output:
Error:  fatal: could not read Username for 'https://github.com/': No such device or address

This however works fine:

      - name: Checkout repository
        uses: actions/checkout@v4
      - name: Setup Java
        uses: actions/setup-java@v4
        with:
          distribution: 'temurin'
          java-version: ${{ matrix.java }}
      - uses: s4u/[email protected]
        with:
          servers: |
            [{
              "id": "ossrh",
              "username": "${{ secrets.OSS_SONATYPE_USERNAME }}",
              "password": "${{ secrets.OSS_SONATYPE_PASSWORD }}"
            }]

Expected behavior
I'd expect to be able to use setup-maven-action.

Additional context
Add any other context about the problem here.

@slawekjaranowski
Copy link
Member

Loos similar to s4u/maven-settings-action#293

@abelsromero
Copy link
Author

I don't think it's related. The is using Git token provided by GH action. My guess is setup-maven-action is doing/or not doing something that breaks them.

@slawekjaranowski
Copy link
Member

slawekjaranowski commented Feb 11, 2024

I did a test #74 - looks like works settings contains expected items

@abelsromero
Copy link
Author

Sorry, I am not making myself clear. The issue is not setting the properties to push to ossh, as shown in the error above, for example when running maven-release-plugin it fails when attempting a GIT push to the repository using the provided GITHUB credential in the pipeline.
Same happened if attempting to run simply touch file && git add . && git commit -m "test" && git push, however, using the other configuration, that works fine. No GIT user problems.

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

No branches or pull requests

2 participants