forked from workloads/github-organization
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutputs.tf
67 lines (56 loc) · 1.98 KB
/
outputs.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
locals {
base_url = "https://github.com"
pack_registry_repository_url = "github.com/${module.repositories["nomad-pack-registry"].github_repository.full_name}"
org_url = "${local.base_url}/orgs/${var.github_owner}"
github_repository_slugs = merge(
module.repositories,
module.terraform_repositories
)
}
output "github_actions_releases" {
description = "GitHub Actions Releases."
# iterate over GitHub Actions Release Objects and assign `full_name` as value
value = {
for identifier, action in local.actions_config : identifier => {
repository = "${action.owner}/${action.repository}"
version = action.version
sha = action.sha
}
}
}
output "github_repository_slugs" {
description = "GitHub Repository slugs."
# iterate over Repository Objects and assign `full_name` as value
value = {
for identifier, repository in local.github_repository_slugs : identifier => repository.github_repository.full_name
}
}
output "github_urls" {
description = "GitHub URLs."
value = [
"${local.base_url}/${var.github_owner}",
local.org_url,
"${local.org_url}/repositories",
"${local.org_url}/teams",
"${local.org_url}/people",
"${local.org_url}/people/pending_invitations",
"${local.org_url}/settings/profile",
"${local.org_url}/settings/security_analysis",
"${local.org_url}/settings/domains",
"${local.org_url}/settings/secrets/actions",
]
}
# enabling this results in _very_ verbose output
#output "non_terraform_repositories" {
# value = local.non_terraform_repositories
#}
output "workspace_url" {
description = "Terraform Cloud Workspace URL."
value = "https://app.terraform.io/app/${var.github_owner}/workspaces/repositories"
}
output "nomad_pack_registry_commands" {
description = "Nomad Pack CLI Commands for Registry operations."
value = {
add_registry = "nomad-pack registry add ${var.github_owner} ${local.pack_registry_repository_url}"
}
}