-
Notifications
You must be signed in to change notification settings - Fork 5
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: use CI_JOB_TOKEN if no PAT provided #7
feat: use CI_JOB_TOKEN if no PAT provided #7
Conversation
@christophwitzko are unit tests for this feature demanded ? If so I would need a simple guideline what exactly to test |
Thanks @superewald looks good to me. I would also like @christophwitzko to weigh in as he wrote the git provider. On tests: I agree that unit tests are probably uncessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @superewald for implementing this. I left some smaller comments.
I'm happy to contribute to this awesome project :) |
Glad to hear! |
It seems that the Windows build is failing because of some |
It's a known bug with GO < 1.20 and windows 2022 image (golang/go#51007). There are 3 possible fixes:
|
I updated go and rebased your pr onto master. 🙏 Thanks again for your contribution 👍 |
This PR adds a feature to use the
CI_JOB_TOKEN
provided for Gitlab CI jobs by default if no PAT was configured (as requested in go-semantic-release/semantic-release#141).implementation
CI_JOB_TOKEN
and thegitlab.JobClient
insteadGetCommit
andGetReleases
will fall back to the Git Provider implementations because the job token can't access private repository informations through the API.tests
I ran tests on a public and private repository in gitlab, both of them succeeded. Probably adding unit tests would be good but I can't think of a good way of testing the feature outside the gitlab ci.