Skip to content
代码片段 群组 项目
未验证 提交 11906787 编辑于 作者: David Dieulivol's avatar David Dieulivol 提交者: GitLab
浏览文件

Merge branch 'kkloss-create-pat-with-organization_id-in-review-apps' into 'master'

Create PAT with organization_id in review apps

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/165965



Merged-by: default avatarDavid Dieulivol <ddieulivol@gitlab.com>
Approved-by: default avatarDavid Dieulivol <ddieulivol@gitlab.com>
Co-authored-by: default avatarKev Kloss <kkloss@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -156,7 +156,15 @@ function disable_sign_ups() {
read -r -d '' multiline_ruby_code <<RUBY
user = User.find_by_username('root');
(puts 'Error: Could not find root user. Check that the database was properly seeded'; exit(1)) unless user;
token = user.personal_access_tokens.create(scopes: [:api], name: 'Token to disable sign-ups', expires_at: 30.days.from_now);
token = user.personal_access_tokens.create(
scopes: [:api],
name: 'Token to disable sign-ups',
expires_at: 30.days.from_now,
organization_id: Gitlab::Current::Organization.new(
params: {},
user: user,
).organization.id
);
token.set_token('${REVIEW_APPS_ROOT_TOKEN}');
begin;
token.save!;
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册