Method: Codebuild::Dsl::Project#github_source

Defined in:
lib/codebuild/dsl/project.rb

#github_source(options = {}) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/codebuild/dsl/project.rb', line 45

def github_source(options={})
  source = {
    type: "GITHUB",
    location: options[:location],
    git_clone_depth: 1,
    git_submodules_config: { fetch_submodules: true },
    build_spec: options[:buildspec] || ".codebuild/buildspec.yml",
    report_build_status: true,
  }

  if options[:oauth_token]
    source[:auth] = {
      type: "OAUTH",
      resource: options[:oauth_token],
    }
  end

  @properties[:source] = source
end