Open Lacront opened 3 years ago
For those with the same issue. Here is a workaround for your Jenkinsfile:
withCredentials([usernamePassword(credentialsId: JENKINS_GIT_CREDENTIALS_ID, passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
sh("git config credential.username ${GIT_USERNAME}")
sh("git config credential.helper '!f() { echo password=$GIT_PASSWORD; }; f'")
}
withCredentials([usernameColonPassword(credentialsId: JENKINS_GIT_CREDENTIALS_ID, variable: 'GIT_CREDENTIALS')]) {
nodejs(JENKINS_NODE_JS_INSTALLATION_LABEL) {
sh("npx semantic-release")
}
}
Hi @Lacront,
Is the plugin handling git authentication differently than semantic-release?
The Git command execution is just the same as semantic-release.
However I noticed that you're using GIT_CREDENTIALS
which I didn't know before.
Comparing the Git executions, I noticed that semantic-release
uses the repository URL when fetching which I don't.
I'll look into that.
@Lacront
Can you try v1.4.1 to see if that fixed your issue?
All right, that does not work and breaks the whole execution.
I'll need to setup a Jenkins to propertly debug that.
Going by your workaround, the GIT_USERNAME and GIT_PASSWORD are not set, even though the Git URL should be created with GIT_CREDENTIALS
by semantic-release.
Hey, I sadly can't get this plugin to work in my Jenkins environment due to Git authentication errors when the plugin attempts to execute
git fetch
.The weird thing is that
semantic-release
itself has no issues with git. It can push version commits and set git tags perfectly fine.Here is my plugin config:
Here is my build step:
And here the error that is thrown:
Is the plugin handling git authentication differently than semantic-release?
Thank you!