Title: Support CI_JOB_TOKEN now that Gitlab added the option for it to push to its own repository which will be released in 17.2 (July 18th) · Issue #977 · python-semantic-release/python-semantic-release · GitHub
Open Graph Title: Support CI_JOB_TOKEN now that Gitlab added the option for it to push to its own repository which will be released in 17.2 (July 18th) · Issue #977 · python-semantic-release/python-semantic-release
X Title: Support CI_JOB_TOKEN now that Gitlab added the option for it to push to its own repository which will be released in 17.2 (July 18th) · Issue #977 · python-semantic-release/python-semantic-release
Description: Description Currently, semantic-release expects an Access Token to be used with Gitlab because the CI_JOB_TOKEN would not allow pushing to the repository. Now that Gitlab has enabled that, it would nice to leverage the CI_JOB_TOKEN inste...
Open Graph Description: Description Currently, semantic-release expects an Access Token to be used with Gitlab because the CI_JOB_TOKEN would not allow pushing to the repository. Now that Gitlab has enabled that, it would...
X Description: Description Currently, semantic-release expects an Access Token to be used with Gitlab because the CI_JOB_TOKEN would not allow pushing to the repository. Now that Gitlab has enabled that, it would...
Opengraph URL: https://github.com/python-semantic-release/python-semantic-release/issues/977
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support CI_JOB_TOKEN now that Gitlab added the option for it to push to its own repository which will be released in 17.2 (July 18th)","articleBody":"## Description\r\n\r\nCurrently, semantic-release expects an Access Token to be used with Gitlab because the CI_JOB_TOKEN would not allow pushing to the repository. Now that Gitlab has enabled that, it would nice to leverage the CI_JOB_TOKEN instead of having to manage expiring tokens per project or group.\r\n\r\n[Allow CI_JOB_TOKEN to push to its own repository #389060](https://gitlab.com/gitlab-org/gitlab/-/issues/389060)\r\n\r\n## Use cases\r\n\r\n* Every project requires an access token with write_repository which creates a new bot user every time\r\n* Group access tokens can be used to limit the number of bots mentioned above, but then security takes a hit\r\n* CI_JOB_TOKEN is better scoped and short-lived\r\n* No expiry of tokens as Gitlab limits access tokens to 1 year now \r\n\r\n## Possible implementation\r\n\r\npython-semantic-release/semantic-release/hvcs/gitlab.py L76 reads:\r\n``` python\r\nself._client = gitlab.Gitlab(self.hvcs_domain.url, private_token=self.token)\r\n```\r\n\r\nCI_JOB_TOKEN requires that the client be created as such:\r\n\r\n``` python\r\nself._client = gitlab.Gitlab(self.hvcs_domain.url, job_token=self.token)\r\n```\r\n\r\nMaybe we could add an extra parameter or check if CI_JOB_TOKEN exists when the environment variable GITLAB_TOKEN is not populated in order to determine which of the two syntax to use.","author":{"url":"https://github.com/fcinqmars","@type":"Person","name":"fcinqmars"},"datePublished":"2024-07-11T19:30:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/977/python-semantic-release/issues/977"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e52f2aca-0584-bf8f-2f83-5d79e7043533 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C8BA:A5FF4:12DA33:189C7A:6992099D |
| html-safe-nonce | a0affd139405033ffe207bf58564a4a594db5f2483d1b578959988597bb5988d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOEJBOkE1RkY0OjEyREEzMzoxODlDN0E6Njk5MjA5OUQiLCJ2aXNpdG9yX2lkIjoiODM3NDE0NTg3MTkyNzk3MDIwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ef325221b824638b759ad6b9c018837eceff7156a671ad89741f643a65661183 |
| hovercard-subject-tag | issue:2403935847 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-semantic-release/python-semantic-release/977/issue_layout |
| twitter:image | https://opengraph.githubassets.com/aeb351094cabb059bffbe2771eca0976e355f078a236a1fe14e604fe26d74a31/python-semantic-release/python-semantic-release/issues/977 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/aeb351094cabb059bffbe2771eca0976e355f078a236a1fe14e604fe26d74a31/python-semantic-release/python-semantic-release/issues/977 |
| og:image:alt | Description Currently, semantic-release expects an Access Token to be used with Gitlab because the CI_JOB_TOKEN would not allow pushing to the repository. Now that Gitlab has enabled that, it would... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fcinqmars |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/python-semantic-release/python-semantic-release git https://github.com/python-semantic-release/python-semantic-release.git |
| octolytics-dimension-user_id | 116517554 |
| octolytics-dimension-user_login | python-semantic-release |
| octolytics-dimension-repository_id | 39765732 |
| octolytics-dimension-repository_nwo | python-semantic-release/python-semantic-release |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 39765732 |
| octolytics-dimension-repository_network_root_nwo | python-semantic-release/python-semantic-release |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 848bc6032dcc93a9a7301dcc3f379a72ba13b96e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width