From 56bc304138e062463b9c60adc0115a0f7e1ffa12 Mon Sep 17 00:00:00 2001 From: Jacopo Carlini Date: Tue, 28 May 2024 10:07:05 +0200 Subject: [PATCH] fix: Federated identity subject (#299) * federated identity fix subject * ref --- github_federated_identity/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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}" }