Skip to content

Commit 66ad1f7

Browse files
authored
Feature add GitHub token (#11)
* Fix codebuild * Fix timeout * Fix timeout * Update README * Address comments * Address comments * Format
1 parent c659c17 commit 66ad1f7

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ module "build" {
4646
| aws_account_id | "" | (Optional) AWS Account ID. Used as `CodeBuild` ENV variable when building Docker images |
4747
| image_repo_name | "UNSET" | (Optional) ECR repository name to store the Docker image built by this module. Used as `CodeBuild` ENV variable when building Docker images |
4848
| image_tag | "latest" | (Optional) Docker image tag in the ECR repository, _e.g._ `latest`. Used as `CodeBuild` ENV variable when building Docker images |
49+
| github_token | "" | (Optional) GitHub auth token environment variable (`GITHUB_TOKEN`) |
4950

5051

5152

main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ resource "aws_codebuild_project" "default" {
105105
"name" = "IMAGE_TAG"
106106
"value" = "${signum(length(var.image_tag)) == 1 ? var.image_tag : "latest"}"
107107
}
108+
109+
environment_variable {
110+
"name" = "GITHUB_TOKEN"
111+
"value" = "${var.github_token}"
112+
}
108113
}
109114

110115
source {

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ variable "privileged_mode" {
4444
description = "(Optional) If set to true, enables running the Docker daemon inside a Docker container on the CodeBuild instance. Used when building Docker images"
4545
}
4646

47+
variable "github_token" {
48+
default = ""
49+
description = "(Optional) GitHub auth token environment variable (`GITHUB_TOKEN`)"
50+
}
51+
4752
variable "aws_region" {
4853
type = "string"
4954
default = ""

0 commit comments

Comments
 (0)