Class: Hyrb::Tasks::Github::CreateProjectTeam

Inherits:
Hyrb::Task
  • Object
show all
Defined in:
lib/hyrb/tasks/github.rb

Instance Attribute Summary

Attributes inherited from Hyrb::Task

#env, #pipeline

Instance Method Summary collapse

Methods inherited from Hyrb::Task

depends, #initialize, prompt, prompts, #run_before

Constructor Details

This class inherits a constructor from Hyrb::Task

Instance Method Details

#run(env) ⇒ Object



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# 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