Skip to content

Commit

Permalink
Attempted fix for integrations#1657 (integrations#1774)
Browse files Browse the repository at this point in the history
- use app_id rather than memory address
- don't mix contexts and checks

Co-authored-by: Keegan Campbell <me@kfcampbell.com>
  • Loading branch information
yaakov-h and kfcampbell committed Jul 13, 2023
1 parent d9e1258 commit e52d970
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions github/resource_github_branch_protection_v3_utils.go
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

0 comments on commit e52d970

Please sign in to comment.