Skip to content

Commit 8ad3299

Browse files
yaakov-hkfcampbell
andauthored
Attempted fix for #1657 (#1774)
- use app_id rather than memory address - don't mix contexts and checks Co-authored-by: Keegan Campbell <me@kfcampbell.com>
1 parent 0de38bc commit 8ad3299

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

github/resource_github_branch_protection_v3_utils.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,16 @@ func flattenAndSetRequiredStatusChecks(d *schema.ResourceData, protection *githu
5353
for _, c := range rsc.Contexts {
5454
// Parse into contexts
5555
contexts = append(contexts, c)
56-
checks = append(contexts, c)
5756
}
5857

5958
// Flatten checks
6059
for _, chk := range rsc.Checks {
61-
// Parse into contexts
62-
contexts = append(contexts, chk.Context)
63-
checks = append(contexts, fmt.Sprintf("%s:%d", chk.Context, chk.AppID))
60+
// Parse into checks
61+
if chk.AppID != nil {
62+
checks = append(checks, fmt.Sprintf("%s:%d", chk.Context, *chk.AppID))
63+
} else {
64+
checks = append(checks, chk.Context)
65+
}
6466
}
6567

6668
return d.Set("required_status_checks", []interface{}{

0 commit comments

Comments
 (0)