From 787b8a9f4894371ac1b8d04197f3aff63f0820b8 Mon Sep 17 00:00:00 2001 From: Fabio Todaro Date: Thu, 26 Jun 2025 14:48:22 +0200 Subject: [PATCH] Fix Repository Custom Properties Refresh --- github/resource_github_repository_custom_property.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/github/resource_github_repository_custom_property.go b/github/resource_github_repository_custom_property.go index 6de2a7dcee..76fb830d50 100644 --- a/github/resource_github_repository_custom_property.go +++ b/github/resource_github_repository_custom_property.go @@ -109,6 +109,11 @@ func resourceGithubRepositoryCustomPropertyRead(d *schema.ResourceData, meta int return err } + if wantedCustomPropertyValue == nil { + d.SetId("") + return nil + } + d.SetId(buildThreePartID(owner, repoName, propertyName)) d.Set("repository", repoName) d.Set("property_name", propertyName) @@ -154,7 +159,7 @@ func readRepositoryCustomPropertyValue(ctx context.Context, client *github.Clien } if wantedCustomProperty == nil { - return nil, fmt.Errorf("could not find a custom property with name: %s", propertyName) + return nil, nil } wantedPropertyValue, err := parseRepositoryCustomPropertyValueToStringSlice(wantedCustomProperty)