Skip to content

Commit

Permalink
fix: gitlab ruby script
Browse files Browse the repository at this point in the history
  • Loading branch information
omri2001 committed Dec 24, 2024
1 parent 61c063d commit e5ef904
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/gitlab-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ data:
# Create the group bot user. For further group access tokens, the username should be `group_{group_id}_bot_{random_string}` and email address `group_{group_id}_bot_{random_string}@noreply.{Gitlab.config.gitlab.host}`.
admin = User.find(1)
random_string = SecureRandom.hex(16)
service_response = Users::CreateService.new(admin, {name: 'g_token', username: "group_#{g.id}_bot_#{random_string}", email: "group_#{g.id}_bot_#{random_string}@noreply.gitlab.local", user_type: :project_bot }).execute
bot = service_response.payload[:user] if service_response.success?
bot = Users::CreateService.new(admin, {name: 'g_token', username: "group_#{g.id}_bot_#{random_string}", email: "group_#{g.id}_bot_#{random_string}@noreply.gitlab.local", user_type: :project_bot }).execute
bot.confirm
# Add the bot to the group with the required role.
Expand Down

0 comments on commit e5ef904

Please sign in to comment.