class Hyrb::Tasks::Github::CreateProjectTeam

Public Instance Methods

run(env) click to toggle source
# File lib/hyrb/tasks/github.rb, line 66
def run(env)
  env.github_team = env.github_client.organization_teams(env.project.github_org).find do |t|
    t.name == env.project.github_team
  end

  if env.github_team
    say "Github team #{env.project.github_team} exists", :yellow
  else
    env.github_team = env.github_client.create_team(env.project.github_org, {
      name: env.project.github_team,
      repo_names: [env.project.repo_name],
      permission: "push"
    })
    say "Created Github team #{env.project.github_team} exists", :green
  end
end