Skip to content

Commit

Permalink
add repo variable
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoieni committed Feb 12, 2025
1 parent 4e65222 commit eee6727
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions terragrunt/modules/rustc-ci/_terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,16 @@ terraform {
}
}
}

variable "repo" {
description = "GitHub repository to authorize. E.g. `rust`. GitHub org is hardcoded to `rust-lang`."
type = string
validation {
condition = !can(regex("/", var.repo))
error_message = "The repo variable must not contain `/`. Only provide the repository name."
}
validation {
condition = length(var.repo) > 0
error_message = "The repo variable must not be empty."
}
}
2 changes: 1 addition & 1 deletion terragrunt/modules/rustc-ci/artifacts.tf
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ resource "aws_iam_role" "try_builds" {
}
Condition = {
StringEquals = {
"token.actions.githubusercontent.com:sub" = "repo:rust-lang/rust:ref:refs/heads/automation/bors/try"
"token.actions.githubusercontent.com:sub" = "repo:rust-lang/${var.repo}:ref:refs/heads/automation/bors/try"
}
}
}
Expand Down

0 comments on commit eee6727

Please sign in to comment.