Skip to content

Commit f85e6c8

Browse files
authored
Update go-github version to v36.0.0 (#841)
* Update go-github version to 36.0.0 * Update go-github to 36.0.0 go-github released the Go client library to [36.0.0][1] 3 days ago. API changes includes: * Add ListOptions required by ListSelectedReposForOrgSecret method. As described in change[2] * Convert repoID used in CreateOrUpdateEnvSecret, GetEnvSecret and DeleteEnvSecret to int from int64. Not sure why it doesn't pop up an error before but seems like this is not a recent change in the new version [1]: https://github.com/google/go-github/releases/tag/v36.0.0 [2]: google/go-github#1883 * Fetch full list of selected repos in github_actions_organization_secret Fix #793
1 parent 8d1c520 commit f85e6c8

File tree

188 files changed

+1887
-448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+1887
-448
lines changed

github/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"net/url"
77
"path"
88

9-
"github.com/google/go-github/v35/github"
9+
"github.com/google/go-github/v36/github"
1010
"github.com/hashicorp/terraform-plugin-sdk/helper/logging"
1111
"github.com/shurcooL/githubv4"
1212
"golang.org/x/oauth2"

github/data_source_github_branch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"log"
66
"net/http"
77

8-
"github.com/google/go-github/v35/github"
8+
"github.com/google/go-github/v36/github"
99
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
1010
)
1111

github/data_source_github_collaborators.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"fmt"
66

7-
"github.com/google/go-github/v35/github"
7+
"github.com/google/go-github/v36/github"
88
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
99
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
1010
)

github/data_source_github_organization.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package github
22

33
import (
4-
"github.com/google/go-github/v35/github"
5-
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
64
"log"
75
"strconv"
6+
7+
"github.com/google/go-github/v36/github"
8+
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
89
)
910

1011
func dataSourceGithubOrganization() *schema.Resource {

github/data_source_github_organization_team_sync_groups.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"log"
77

8-
"github.com/google/go-github/v35/github"
8+
"github.com/google/go-github/v36/github"
99
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
1010
)
1111

github/data_source_github_release.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package github
33
import (
44
"context"
55
"fmt"
6-
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
76
"log"
87
"strconv"
98
"strings"
109

11-
"github.com/google/go-github/v35/github"
10+
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
11+
12+
"github.com/google/go-github/v36/github"
1213
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
1314
)
1415

github/data_source_github_repositories.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"log"
66

7-
"github.com/google/go-github/v35/github"
7+
"github.com/google/go-github/v36/github"
88
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
99
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
1010
)

github/data_source_github_repository_pull_requests.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"strings"
66

7-
"github.com/google/go-github/v35/github"
7+
"github.com/google/go-github/v36/github"
88
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
99
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
1010
)

github/data_source_github_team.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"log"
66
"strconv"
77

8-
"github.com/google/go-github/v35/github"
8+
"github.com/google/go-github/v36/github"
99

1010
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
1111
)

github/resource_github_actions_environment_secret.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"log"
77
"net/http"
88

9-
"github.com/google/go-github/v35/github"
9+
"github.com/google/go-github/v36/github"
1010
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
1111
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
1212
)
@@ -99,7 +99,7 @@ func resourceGithubActionsEnvironmentSecretCreateOrUpdate(d *schema.ResourceData
9999
EncryptedValue: encryptedValue,
100100
}
101101

102-
_, err = client.Actions.CreateOrUpdateEnvSecret(ctx, repo.GetID(), envName, eSecret)
102+
_, err = client.Actions.CreateOrUpdateEnvSecret(ctx, int(repo.GetID()), envName, eSecret)
103103
if err != nil {
104104
return err
105105
}
@@ -123,7 +123,7 @@ func resourceGithubActionsEnvironmentSecretRead(d *schema.ResourceData, meta int
123123
return err
124124
}
125125

126-
secret, _, err := client.Actions.GetEnvSecret(ctx, repo.GetID(), envName, secretName)
126+
secret, _, err := client.Actions.GetEnvSecret(ctx, int(repo.GetID()), envName, secretName)
127127
if err != nil {
128128
if ghErr, ok := err.(*github.ErrorResponse); ok {
129129
if ghErr.Response.StatusCode == http.StatusNotFound {
@@ -179,7 +179,7 @@ func resourceGithubActionsEnvironmentSecretDelete(d *schema.ResourceData, meta i
179179
return err
180180
}
181181
log.Printf("[DEBUG] Deleting environment secret: %s", d.Id())
182-
_, err = client.Actions.DeleteEnvSecret(ctx, repo.GetID(), envName, secretName)
182+
_, err = client.Actions.DeleteEnvSecret(ctx, int(repo.GetID()), envName, secretName)
183183

184184
return err
185185
}

0 commit comments

Comments
 (0)