diff --git a/github_federated_identity/main.tf b/github_federated_identity/main.tf index 352eddf7..20f9d8e9 100644 --- a/github_federated_identity/main.tf +++ b/github_federated_identity/main.tf @@ -48,5 +48,5 @@ resource "azurerm_federated_identity_credential" "identity_credentials" { audience = each.value.audience issuer = each.value.issuer parent_id = azurerm_user_assigned_identity.identity.id - subject = "repo:${each.value.org}/${each.value.repository}:${each.value.credentials_scope}:${each.value.subject}" + subject = each.value.subject == "pull_request" ? "repo:${each.value.org}/${each.value.repository}:${each.value.subject}" : "repo:${each.value.org}/${each.value.repository}:${each.value.credentials_scope}:${each.value.subject}" }