Skip to content

Commit

Permalink
Update go-github version to 36.0.0
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
xun-guo-anzx committed Jun 29, 2021
1 parent 4e45222 commit 01941d5
Show file tree
Hide file tree
Showing 188 changed files with 1,877 additions and 443 deletions.
2 changes: 1 addition & 1 deletion github/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/url"
"path"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/logging"
"github.com/shurcooL/githubv4"
"golang.org/x/oauth2"
Expand Down
2 changes: 1 addition & 1 deletion github/data_source_github_branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"net/http"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/data_source_github_collaborators.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
)
Expand Down
5 changes: 3 additions & 2 deletions github/data_source_github_organization.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package github

import (
"github.com/google/go-github/v35/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"log"
"strconv"

"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

func dataSourceGithubOrganization() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion github/data_source_github_organization_team_sync_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
5 changes: 3 additions & 2 deletions github/data_source_github_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package github
import (
"context"
"fmt"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"log"
"strconv"
"strings"

"github.com/google/go-github/v35/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"

"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/data_source_github_repositories.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"log"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
)
Expand Down
2 changes: 1 addition & 1 deletion github/data_source_github_repository_pull_requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"strings"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
)
Expand Down
2 changes: 1 addition & 1 deletion github/data_source_github_team.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"strconv"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)
Expand Down
8 changes: 4 additions & 4 deletions github/resource_github_actions_environment_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"net/http"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
)
Expand Down Expand Up @@ -99,7 +99,7 @@ func resourceGithubActionsEnvironmentSecretCreateOrUpdate(d *schema.ResourceData
EncryptedValue: encryptedValue,
}

_, err = client.Actions.CreateOrUpdateEnvSecret(ctx, repo.GetID(), envName, eSecret)
_, err = client.Actions.CreateOrUpdateEnvSecret(ctx, int(repo.GetID()), envName, eSecret)
if err != nil {
return err
}
Expand All @@ -123,7 +123,7 @@ func resourceGithubActionsEnvironmentSecretRead(d *schema.ResourceData, meta int
return err
}

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

return err
}
Expand Down
7 changes: 5 additions & 2 deletions github/resource_github_actions_organization_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"log"
"net/http"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
)
Expand Down Expand Up @@ -160,7 +160,10 @@ func resourceGithubActionsOrganizationSecretRead(d *schema.ResourceData, meta in
selectedRepositoryIDs := []int64{}

if secret.Visibility == "selected" {
selectedRepoList, _, err := client.Actions.ListSelectedReposForOrgSecret(ctx, owner, d.Id())
opts := &github.ListOptions{
PerPage: 30,
}
selectedRepoList, _, err := client.Actions.ListSelectedReposForOrgSecret(ctx, owner, d.Id(), opts)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_actions_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"log"
"net/http"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"golang.org/x/crypto/nacl/box"
)
Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_app_installation_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"strconv"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http"
"strings"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_branch_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"log"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_branch_protection_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"net/http"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
)
Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_branch_protection_v3_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"log"
"strings"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_issue_label.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"net/http"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"net/http"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_membership_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"testing"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)
Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_organization_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http"
"strconv"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_organization_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"testing"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)
Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_organization_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"
"strconv"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_project_card.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
"strings"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_project_column.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
"strings"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_project_column_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"
"testing"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)
Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"regexp"
"strings"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
)
Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_repository_collaborator.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http"
"strings"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_repository_deploy_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strconv"
"strings"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_repository_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"
"strconv"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
)
Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_repository_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"fmt"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_repository_milestone.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"time"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
)
Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_repository_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strconv"
"strings"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_repository_pull_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
"strings"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_repository_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strconv"
"strings"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_team.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"
"strconv"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/customdiff"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/shurcooL/githubv4"
Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_team_membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"
"strconv"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_team_membership_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
"testing"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v36/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
Expand Down
Loading

0 comments on commit 01941d5

Please sign in to comment.