This repository was archived by the owner on May 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
This repository was archived by the owner on May 23, 2025. It is now read-only.
Git Authentication issues on Jenkins job #12
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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:
"release": {
"branches": [
"master",
{
"name": "develop",
"prerelease": "dev"
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/git",
{
"message": "chore: [RELEASE] Upgrade to ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
[
"@saithodev/semantic-release-backmerge",
{
"branchName": "develop",
"backmergeStrategy": "merge",
"message": "chore: [RELEASE] Preparations for next release ${nextRelease.version} [skip ci]"
}
]
]
}
Here is my build step:
stage('Create Version') {
when {
expression {
return !noActualChanges
}
}
steps {
withCredentials([usernameColonPassword(credentialsId: JENKINS_GIT_CREDENTIALS_ID, variable: 'GIT_CREDENTIALS')]) {
nodejs(JENKINS_NODE_JS_INSTALLATION_LABEL) {
sh 'npx semantic-release'
}
}
withCredentials([usernamePassword(credentialsId: JENKINS_GIT_CREDENTIALS_ID, passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
sh("git push https://${GIT_USERNAME}:${GIT_PASSWORD}@${GIT_REPO} ${GIT_BRANCH} --tags")
}
}
}
And here the error that is thrown:
[5:52:50 PM] [semantic-release] › ✔ Completed step "prepare" of plugin "@semantic-release/npm"
[5:52:50 PM] [semantic-release] › ℹ Start step "prepare" of plugin "@semantic-release/git"
[5:52:50 PM] [semantic-release] [@semantic-release/git] › ℹ Found 2 file(s) to commit
[5:52:51 PM] [semantic-release] [@semantic-release/git] › ℹ Prepared Git release: v1.0.81
[5:52:51 PM] [semantic-release] › ✔ Completed step "prepare" of plugin "@semantic-release/git"
[5:52:51 PM] [semantic-release] › ℹ Start step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[5:52:51 PM] [semantic-release] › ✔ Completed step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[5:52:53 PM] [semantic-release] › ✔ Created tag v1.0.81
[5:52:53 PM] [semantic-release] › ℹ Start step "publish" of plugin "@semantic-release/npm"
[5:52:53 PM] [semantic-release] [@semantic-release/npm] › ℹ Skip publishing to npm registry as npmPublish is false
[5:52:53 PM] [semantic-release] › ✔ Completed step "publish" of plugin "@semantic-release/npm"
[5:52:53 PM] [semantic-release] › ℹ Start step "success" of plugin "@saithodev/semantic-release-backmerge"
[5:52:53 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ℹ Release succeeded. Performing back-merge into branch "develop".
[5:52:53 PM] [semantic-release] › ✖ Failed step "success" of plugin "@saithodev/semantic-release-backmerge"
[5:52:53 PM] [semantic-release] › ✖ An error occurred while running semantic-release: Error: Command failed with exit code 128: git fetch
fatal: Authentication failed for 'https://tasktrack..../bitbucket/scm/ccf/microfrontend-...-next.git/'
at makeError (/home/jenkins/workspace/microfrontend-...-next CD/node_modules/@saithodev/semantic-release-backmerge/node_modules/execa/lib/error.js:59:11)
at handlePromise (/home/jenkins/workspace/microfrontend-...-next CD/node_modules/@saithodev/semantic-release-backmerge/node_modules/execa/index.js:114:26)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
shortMessage: 'Command failed with exit code 128: git fetch',
command: 'git fetch',
exitCode: 128,
signal: undefined,
signalDescription: undefined,
stdout: '',
stderr: "fatal: Authentication failed for 'https://tasktrack..../bitbucket/scm/ccf/microfrontend-...-next.git/'",
failed: true,
timedOut: false,
isCanceled: false,
killed: false,
pluginName: '@saithodev/semantic-release-backmerge'
}
AggregateError:
Error: Command failed with exit code 128: git fetch
fatal: Authentication failed for 'https://tasktrack..../bitbucket/scm/ccf/microfrontend-...-next.git/'
at makeError (/home/jenkins/workspace/microfrontend-...-next CD/node_modules/@saithodev/semantic-release-backmerge/node_modules/execa/lib/error.js:59:11)
at handlePromise (/home/jenkins/workspace/microfrontend-...-next CD/node_modules/@saithodev/semantic-release-backmerge/node_modules/execa/index.js:114:26)
at /home/jenkins/workspace/microfrontend-...-next CD/node_modules/�[4msemantic-release�[24m/lib/plugins/pipeline.js:54:11
�[90m at processTicksAndRejections (internal/process/task_queues.js:97:5)�[39m
at async Object.pluginsConf.<computed> [as success] (/home/jenkins/workspace/microfrontend-...-next CD/node_modules/�[4msemantic-release�[24m/lib/plugins/index.js:80:11)
at async run (/home/jenkins/workspace/microfrontend-...-next CD/node_modules/�[4msemantic-release�[24m/index.js:201:3)
at async module.exports (/home/jenkins/workspace/microfrontend-...-next CD/node_modules/�[4msemantic-release�[24m/index.js:260:22)
at async module.exports (/home/jenkins/workspace/microfrontend-...-next CD/node_modules/�[4msemantic-release�[24m/cli.js:55:5)
Is the plugin handling git authentication differently than semantic-release?
Thank you!
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working