question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow use of Gitlab Project Access Tokens

See original GitHub issue

Description

This is a relatively new feature of Gitlab where you can create a project access token that further creates a bot user that allows you to interact with the git repo and gitlab API. See more here: https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html#project-access-tokens

I’m trying to use it but I think the problem is the Git username for Gitlab is hardcoded

https://github.com/relekang/python-semantic-release/blob/20d79a51bffa26d40607c1b77d10912992279112/semantic_release/vcs_helpers.py#L230

Possible implementation

  1. Look for an optional GITLAB_BOT_USER environment variable so the project access tokens are entirely optional
  2. Or, make everyone migrate to project access tokens for Gitlab and force an “actor” to be specified like is currently done for Github. Or just default to the format that Gitlab says: project_{CI_PROJECT_ID}_bot where CI_PROJECT_ID is a predefined environment variable available in the Gitlab jobs.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
Andrew13648commented, May 28, 2021

@alexifm You can actually use the access token by overriding the remote URL, although I agree it would be nice to have a feature integrated within python-semantic-release to make this cleaner. For example, I can use a project access token by running this:

git remote set-url origin https://root:$ACCESS_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_PATH.git

Now my semantic-release publish will commit using the token.

0reactions
github-actions[bot]commented, Nov 15, 2022

This feature request has been labelled as help wanted since there has been no activity in the last 3 weeks. It will not be closed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Project access tokens - GitLab Docs
Enable or disable project access token creation · On the top bar, select Main menu > Groups and find your group. · On...
Read more >
Project access tokens · Settings - Help · GitLab - ETSI Forge
Log in to GitLab. · Navigate to the project you would like to create an access token for. · In the Settings menu...
Read more >
Access GitLab repo with project access token - Stack Overflow
With Git, when using HTTP Basic Authentication, use: Any non-blank value as a username. The project access token as the password.
Read more >
Project access tokens · Settings · Project · User · Help · GitLab
Enable or disable project access token creation · On the top bar, select Main menu > Groups and find your group. · On...
Read more >
Using GitLab Access Tokens effectively - Eficode
Global. Deploy token. Grants global admin permissions for all repositories for reading. ; Project and Group. Trigger tokens. Allows CI/CD ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found