Open felixprado-mc opened 5 months ago
Thanks for the detailed description @felixprado-mc!
I have not yet of heard of such issues, so let's start with a few basic questions:
Hi @fgreinacher ,
I appreciate your interest.
1, 2, 3, The project is hosted on gitlab.com but it's private so I can't share it. 4, It has never worked before but we have the same configuration for other projects, and it works. I have checked if there is something in the project's or token's configuration but I don't see anything. 5, Which configuration do you propose?
What should be the scope/permissions for the GL_TOKEN?
If this adds more information, we run this step in a Gitlab CI pipeline with the following commands:
npm install @semantic-release/gitlab
npm install @semantic-release/git
npm install @semantic-release/changelog
npm install @semantic-release/commit-analyzer
npx semantic-release
Thanks for sharing some details!
You could start very simple like this:
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/gitlab"
]
}
And if that works add your configuration options one-by-one until it starts failing.
Hi @fgreinacher ,
I appreciate your interest.
1, 2, 3, The project is hosted on gitlab.com but it's private so I can't share it. 4, It has never worked before but we have the same configuration for other projects, and it works. I have checked if there is something in the project's or token's configuration but I don't see anything. 5, Which configuration do you propose?
What should be the scope/permissions for the GL_TOKEN?
If this adds more information, we run this step in a Gitlab CI pipeline with the following commands:
npm install @semantic-release/gitlab npm install @semantic-release/git npm install @semantic-release/changelog npm install @semantic-release/commit-analyzer npx semantic-release
Hi @felixprado-mc, regarding 4:\ You have the exact same configuration and also the exact same gitlab token in other projects and in these other projects it is working? Just not in this particular one?\
Hi @JonasSchubert. Thanks for the support.
You have the same configuration and also the same gitlab token in other projects and in these other projects it is working? Just not in this particular one?\
The tokens are different ones, but they have the same permissions (they are created centrally with Terraform). Regarding the repository configuration, I've checked multiple times the protected branches or tags, the users that have permission to commit (including the token) and I see no difference.
- is the not working project maybe private and the others internal/public?
All of them are private.
- is the branch semantic release tries to push/commit not writable (no one is allowed to push)?
It is specifically allowed for the token.
- was the repository created after the token was created? (then permissions might not be included)
No, the tokens were created after the repository was created.
- can you think of any other configuration that differs between the projects?
I ran out of ideas of what is causing this, that's why I opened this thread. What is even stranger is that it fails in the first attempt, but works on the second.
I have the same issue. @felixprado-mc Do you resolve this problem?
I'm also having this issue after upgrading semantic-release.
2024-10-11T19:22:03.054Z semantic-release:get-git-auth-url Error: Command failed with exit code 128: git push --dry-run --no-verify [https://gitlab-ci-token:[secure]@gitlab.com/my/org/private/repo.git](https://gitlab-ci-token:%5Bsecure%5D@gitlab.com/my/org/private/repo.git) HEAD:main
remote: You are not allowed to push code to this project.
fatal: unable to access 'https://gitlab.com/my/org/private/repo.git/': The requested URL returned error: 403
at the bottom I see an even stranger:
2024-10-11T19:22:03.065Z semantic-release:get-git-auth-url Using "GL_TOKEN" to authenticate
[7:22:05 PM] [semantic-release] › ℹ Start step "fail" of plugin "@semantic-release/github"
[7:22:05 PM] [semantic-release] [@semantic-release/github] › ℹ Verify GitHub authentication
[7:22:05 PM] [semantic-release] › ✖ Failed step "fail" of plugin "@semantic-release/github"
[7:22:05 PM] [semantic-release] › ✖ ENOGHTOKEN No GitHub token specified.
A GitHub personal token (https://github.com/semantic-release/github/blob/master/README.md#github-authentication) must be created and set in the GH_TOKEN or GITHUB_TOKEN environment variable on your CI environment.
Please make sure to create a GitHub personal token (https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line) and to set it in the GH_TOKEN or GITHUB_TOKEN environment variable on your CI environment. The token must allow to push to the repository my/org/private/repo.
which is odd because nowhere in my repo do I use the github plugin:
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/gitlab'
],
I do have GITLAB_TOKEN set however, per the README
I get this error when executing the plugin in a Gitlab CI pipeline. It only happens the first time, because in the second execution it works fine.
I have a GL_TOKEN with the right permissions over the project.
Could anyone help?
This is the .releaserc file of the project:
and the package.json: