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

feat: Align algorith to aquire tokens with goreleaser #9

Merged
merged 3 commits into from
Jul 26, 2024

Conversation

asmfreak
Copy link
Contributor

This PR solves an inconsistency between provider-gitlab and hook-goreleaser when running in ci.

hook-goreleaser (and plain goreleaser) gets GITLAB_TOKEN, which is then checked against CI_JOB_TOKEN variable later in code. It then uses different API constructor calls to upload the release. It fails to find GITLAB_TOKEN, it will fail the release process.

provider-gitlab uses blindly GITLAB_TOKEN and assumes it is a valid api token. If it is missing, it uses CI_JOB_TOKEN with git repo. This fails in a situation where GITLAB_TOKEN == CI_JOB_TOKEN, since CI_JOB_TOKEN does NOT have access to the needed APIs.

This situation creates an impasse to run semantic-release with hook-goreleaser in Gitlab-CI with just a job token. This PR fixes this problem by aligning token fetching algorithms.

@christophwitzko
Copy link
Member

@asmfreak thank you ✨

@asmfreak
Copy link
Contributor Author

Is the workflow ok? Maybe release should not run on PRs?

@christophwitzko christophwitzko merged commit f6bfb19 into go-semantic-release:master Jul 26, 2024
4 of 5 checks passed
@asmfreak asmfreak deleted the patch-1 branch July 26, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants