ruckc
ruckc

Reputation: 543

initial access token for gitlab

Is there an automated way to get a personal access token for the root user of gitlab after deploying? Trying to automate some post-deployment API configuration, but currently it requires creating a personal access token manually.

Upvotes: 1

Views: 686

Answers (1)

ruckc
ruckc

Reputation: 543

Found this finally.

gitlab-rails runner "token = User.find_by_username('automation-bot').personal_access_tokens.create(scopes: [:read_user, :read_repository], name: 'Automation token'); token.set_token('token-string-here123'); token.save!"

Upvotes: 1

Related Questions