Skip to content

Commit

Permalink
fix: Prevent duplicate GitHub thumbprints (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
witalisoft authored Jun 28, 2023
1 parent 52b5db3 commit 35f725d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ resource "aws_iam_openid_connect_provider" "github" {

tags = var.tags
url = "https://token.actions.githubusercontent.com%{if var.enterprise_slug != ""}/${var.enterprise_slug}%{endif}"
thumbprint_list = var.additional_thumbprints != null ? concat(
[data.tls_certificate.github.certificates[0].sha1_fingerprint],
[for thumbprint in var.additional_thumbprints : thumbprint]
thumbprint_list = var.additional_thumbprints != null ? distinct(
concat(
[data.tls_certificate.github.certificates[0].sha1_fingerprint],
[for thumbprint in var.additional_thumbprints : thumbprint]
)
) : [data.tls_certificate.github.certificates[0].sha1_fingerprint]
}

0 comments on commit 35f725d

Please sign in to comment.