Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion infra/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ resource "google_iam_workload_identity_pool_provider" "github_provider" {
"attribute.ref" = "assertion.ref"
}

attribute_condition = "assertion.repository == '${var.github_org}/${var.github_repo}' && assertion.ref == 'refs/heads/main'"
# Allow authentication only from this repository and the dev/main deployment branches
attribute_condition = "assertion.repository == '${var.github_org}/${var.github_repo}' && (assertion.ref == 'refs/heads/dev' || assertion.ref == 'refs/heads/main')"

oidc {
issuer_uri = "https://token.actions.githubusercontent.com"
Expand Down
2 changes: 0 additions & 2 deletions infra/staging.tfvars
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
project_id = "student-progress-staging"
environment = "staging"
github_org = "aga87"
github_repo = "student-progress-api"
6 changes: 4 additions & 2 deletions infra/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ variable "db_name" {
}

variable "github_org" {
type = string
type = string
default = "aga87"
}

variable "github_repo" {
type = string
type = string
default = "student-progress-api"
}