Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempted fix for #1657 #1774

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions github/resource_github_branch_protection_v3_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ func flattenAndSetRequiredStatusChecks(d *schema.ResourceData, protection *githu
for _, c := range rsc.Contexts {
// Parse into contexts
contexts = append(contexts, c)
checks = append(contexts, c)
}

// Flatten checks
for _, chk := range rsc.Checks {
// Parse into contexts
contexts = append(contexts, chk.Context)
checks = append(contexts, fmt.Sprintf("%s:%d", chk.Context, chk.AppID))
// Parse into checks
if chk.AppID != nil {
checks = append(checks, fmt.Sprintf("%s:%d", chk.Context, *chk.AppID))
} else {
checks = append(checks, chk.Context)
}
}

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