Skip to content

Commit 5242e15

Browse files
fix reading of deleted resources (#27)
1 parent 2e38f9e commit 5242e15

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

githubfile/resource_file.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ func resourceFileRead(d *schema.ResourceData, m interface{}) error {
180180
f := expandFile(d)
181181

182182
h, err := ghfileutils.GetFile(context.Background(), c.githubClient, f.repositoryOwner, f.repositoryName, f.branch, f.path)
183+
if err == ghfileutils.ErrNotFound {
184+
d.SetId("")
185+
return nil
186+
}
183187
if err != nil {
184188
return err
185189
}

0 commit comments

Comments
 (0)