Open Ardesco opened 1 year ago
OK I fixed it by passing in env variable instead of the secrets directly like this:
- name: Set up Sonatype Snapshots Repository
uses: s4u/maven-settings-action@v2.8.0
with:
githubServer: false
sonatypeSnapshots: true
servers: |
[{
"id": "sonatype-nexus-snapshots",
"username": "${env.MAVEN_USERNAME}",
"password": "${env.MAVEN_PASSWORD}",
"privateKey": "${env.MAVEN_PRIVATE_KEY}",
"passphrase": "${env.MAVEN_PASSPHRASE}"
}]
- name: Publish to Sonatype Snapshots Repository
run: mvn clean deploy -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
MAVEN_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
Not sure why that difference matters, may be worth adding that to the documentation
Probably your password contains a char which brake json parsing.
By the way providing sensitive data is better by environment variable it will not store in settings file.
PR with documentation improvement and examples are welcome 😄
Describe the bug
I'm getting an unexpected token error:
The config I have is:
It looks like the position lines up with the
${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
entry, but it;'s hard to work out why it's upset.To Reproduce
Being reproduced on all my builds at the moment, but as I'm not sure of the exact cause I can't really provide repo instructions here.
Expected behaviour
My settings.xml setup should complete without issue.
Additional context
Could this be related to some characters in my GPG Private Key? Possible escaping issue maybe? I'm really looking for hints to help diagnose the problem.