Skip to content

Commit 36bf7c9

Browse files
fix: Repository Custom Properties Refresh (#2691)
Co-authored-by: Nick Floyd <[email protected]>
1 parent 59fd2b7 commit 36bf7c9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

github/resource_github_repository_custom_property.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ func resourceGithubRepositoryCustomPropertyRead(d *schema.ResourceData, meta int
109109
return err
110110
}
111111

112+
if wantedCustomPropertyValue == nil {
113+
d.SetId("")
114+
return nil
115+
}
116+
112117
d.SetId(buildThreePartID(owner, repoName, propertyName))
113118
d.Set("repository", repoName)
114119
d.Set("property_name", propertyName)
@@ -154,7 +159,7 @@ func readRepositoryCustomPropertyValue(ctx context.Context, client *github.Clien
154159
}
155160

156161
if wantedCustomProperty == nil {
157-
return nil, fmt.Errorf("could not find a custom property with name: %s", propertyName)
162+
return nil, nil
158163
}
159164

160165
wantedPropertyValue, err := parseRepositoryCustomPropertyValueToStringSlice(wantedCustomProperty)

0 commit comments

Comments
 (0)