File tree Expand file tree Collapse file tree
examples/oidc_custom_property Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ terraform {
2+ required_providers {
3+ github = {
4+ source = " integrations/github"
5+ }
6+ }
7+ }
8+
9+ provider "github" {
10+ owner = var. github_owner
11+ }
12+
13+ variable "github_owner" {
14+ description = " The GitHub organization to manage"
15+ type = string
16+ }
17+
18+ # Step 1: Define an org-level custom property
19+ resource "github_organization_custom_properties" "environment" {
20+ property_name = " environment"
21+ value_type = " single_select"
22+ required = false
23+ allowed_values = [" production" , " staging" , " development" ]
24+ }
25+
26+ # Step 2: Include the custom property in OIDC tokens
27+ resource "github_actions_organization_oidc_custom_property_inclusion" "environment" {
28+ custom_property_name = " environment"
29+ depends_on = [github_organization_custom_properties . environment ]
30+ }
31+
32+ # Step 3: Read back the inclusions via data source
33+ data "github_actions_organization_oidc_custom_property_inclusions" "current" {
34+ depends_on = [github_actions_organization_oidc_custom_property_inclusion . environment ]
35+ }
36+
37+ output "included_properties" {
38+ value = data. github_actions_organization_oidc_custom_property_inclusions . current . custom_property_names
39+ }
You can’t perform that action at this time.
0 commit comments