diff --git a/github/config.go b/github/config.go index bcb6fe00c3..2d13995e36 100644 --- a/github/config.go +++ b/github/config.go @@ -8,7 +8,7 @@ import ( "path" "time" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/logging" "github.com/shurcooL/githubv4" "golang.org/x/oauth2" diff --git a/github/data_source_github_branch.go b/github/data_source_github_branch.go index f5e572b949..c9a2c2f301 100644 --- a/github/data_source_github_branch.go +++ b/github/data_source_github_branch.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/data_source_github_collaborators.go b/github/data_source_github_collaborators.go index d7f9e963de..ee266f6825 100644 --- a/github/data_source_github_collaborators.go +++ b/github/data_source_github_collaborators.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/data_source_github_organization.go b/github/data_source_github_organization.go index 9f00751e5b..6dbf51681f 100644 --- a/github/data_source_github_organization.go +++ b/github/data_source_github_organization.go @@ -4,7 +4,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/data_source_github_organization_team_sync_groups.go b/github/data_source_github_organization_team_sync_groups.go index 8f643e742b..824064ea1a 100644 --- a/github/data_source_github_organization_team_sync_groups.go +++ b/github/data_source_github_organization_team_sync_groups.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/data_source_github_release.go b/github/data_source_github_release.go index 7383bd2077..7d1c90a22f 100644 --- a/github/data_source_github_release.go +++ b/github/data_source_github_release.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/data_source_github_repositories.go b/github/data_source_github_repositories.go index 981236e9c2..578fe5af47 100644 --- a/github/data_source_github_repositories.go +++ b/github/data_source_github_repositories.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/data_source_github_repository_file.go b/github/data_source_github_repository_file.go index b768af59a7..e6d971b7cf 100644 --- a/github/data_source_github_repository_file.go +++ b/github/data_source_github_repository_file.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/data_source_github_repository_pull_requests.go b/github/data_source_github_repository_pull_requests.go index f2497f8b5d..b010cf479e 100644 --- a/github/data_source_github_repository_pull_requests.go +++ b/github/data_source_github_repository_pull_requests.go @@ -4,7 +4,7 @@ import ( "context" "strings" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/data_source_github_team.go b/github/data_source_github_team.go index fc3fc61ed6..d85da3e20c 100644 --- a/github/data_source_github_team.go +++ b/github/data_source_github_team.go @@ -5,7 +5,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/repository_utils.go b/github/repository_utils.go index 005389135c..fb9f0198f1 100644 --- a/github/repository_utils.go +++ b/github/repository_utils.go @@ -7,7 +7,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" ) // checkRepositoryBranchExists tests if a branch exists in a repository. diff --git a/github/resource_github_actions_environment_secret.go b/github/resource_github_actions_environment_secret.go index 9f79a53166..4dd4c82b19 100644 --- a/github/resource_github_actions_environment_secret.go +++ b/github/resource_github_actions_environment_secret.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_actions_organization_permissions.go b/github/resource_github_actions_organization_permissions.go index 0eab5e002f..cdcbd2a253 100644 --- a/github/resource_github_actions_organization_permissions.go +++ b/github/resource_github_actions_organization_permissions.go @@ -5,7 +5,7 @@ import ( "errors" "log" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_actions_organization_secret.go b/github/resource_github_actions_organization_secret.go index c77d6769d0..366c72741e 100644 --- a/github/resource_github_actions_organization_secret.go +++ b/github/resource_github_actions_organization_secret.go @@ -7,7 +7,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_actions_organization_secret_repositories.go b/github/resource_github_actions_organization_secret_repositories.go index 9f57eb659c..533e7234b8 100644 --- a/github/resource_github_actions_organization_secret_repositories.go +++ b/github/resource_github_actions_organization_secret_repositories.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_actions_runner_group.go b/github/resource_github_actions_runner_group.go index ed1595dbf6..a44cf613ea 100644 --- a/github/resource_github_actions_runner_group.go +++ b/github/resource_github_actions_runner_group.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_actions_secret.go b/github/resource_github_actions_secret.go index d26df519c0..804302d17f 100644 --- a/github/resource_github_actions_secret.go +++ b/github/resource_github_actions_secret.go @@ -7,7 +7,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "golang.org/x/crypto/nacl/box" ) diff --git a/github/resource_github_app_installation_repository.go b/github/resource_github_app_installation_repository.go index 72023dd66b..4c4ebfa00c 100644 --- a/github/resource_github_app_installation_repository.go +++ b/github/resource_github_app_installation_repository.go @@ -5,7 +5,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_branch.go b/github/resource_github_branch.go index 7d1115858b..822fe290c1 100644 --- a/github/resource_github_branch.go +++ b/github/resource_github_branch.go @@ -7,7 +7,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_branch_default.go b/github/resource_github_branch_default.go index 7cea900094..c44828b811 100644 --- a/github/resource_github_branch_default.go +++ b/github/resource_github_branch_default.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_branch_protection_v3.go b/github/resource_github_branch_protection_v3.go index 9ae08768d5..c2017bcb24 100644 --- a/github/resource_github_branch_protection_v3.go +++ b/github/resource_github_branch_protection_v3.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_branch_protection_v3_utils.go b/github/resource_github_branch_protection_v3_utils.go index bb06916f08..c463476f60 100644 --- a/github/resource_github_branch_protection_v3_utils.go +++ b/github/resource_github_branch_protection_v3_utils.go @@ -7,7 +7,7 @@ import ( "log" "strings" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_issue_label.go b/github/resource_github_issue_label.go index a139b221c0..262826852a 100644 --- a/github/resource_github_issue_label.go +++ b/github/resource_github_issue_label.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_membership.go b/github/resource_github_membership.go index d2984a90e0..c1cbe06744 100644 --- a/github/resource_github_membership.go +++ b/github/resource_github_membership.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_membership_test.go b/github/resource_github_membership_test.go index 41ee3f7563..ede04e1126 100644 --- a/github/resource_github_membership_test.go +++ b/github/resource_github_membership_test.go @@ -6,7 +6,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) diff --git a/github/resource_github_organization_project.go b/github/resource_github_organization_project.go index 798f3197b4..61d07ffbb1 100644 --- a/github/resource_github_organization_project.go +++ b/github/resource_github_organization_project.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_organization_project_test.go b/github/resource_github_organization_project_test.go index 76dd2c556d..4ee40b3cc0 100644 --- a/github/resource_github_organization_project_test.go +++ b/github/resource_github_organization_project_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) diff --git a/github/resource_github_organization_webhook.go b/github/resource_github_organization_webhook.go index 2d4d76645f..d24d0eca37 100644 --- a/github/resource_github_organization_webhook.go +++ b/github/resource_github_organization_webhook.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_project_card.go b/github/resource_github_project_card.go index 7f3d5ad447..10473999bd 100644 --- a/github/resource_github_project_card.go +++ b/github/resource_github_project_card.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_project_column.go b/github/resource_github_project_column.go index d9b38871b9..f7932551fb 100644 --- a/github/resource_github_project_column.go +++ b/github/resource_github_project_column.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_project_column_test.go b/github/resource_github_project_column_test.go index 94aad62b40..7d55e76ab5 100644 --- a/github/resource_github_project_column_test.go +++ b/github/resource_github_project_column_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) diff --git a/github/resource_github_repository.go b/github/resource_github_repository.go index 2550565720..b63f5c3e63 100644 --- a/github/resource_github_repository.go +++ b/github/resource_github_repository.go @@ -9,7 +9,7 @@ import ( "regexp" "strings" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_repository_autolink_reference.go b/github/resource_github_repository_autolink_reference.go index 000ff7e055..833951d519 100644 --- a/github/resource_github_repository_autolink_reference.go +++ b/github/resource_github_repository_autolink_reference.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_repository_collaborator.go b/github/resource_github_repository_collaborator.go index 670e2b5ef1..848a0f6be1 100644 --- a/github/resource_github_repository_collaborator.go +++ b/github/resource_github_repository_collaborator.go @@ -7,7 +7,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_repository_deploy_key.go b/github/resource_github_repository_deploy_key.go index 89f03af0d6..09c48e5d2a 100644 --- a/github/resource_github_repository_deploy_key.go +++ b/github/resource_github_repository_deploy_key.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_repository_environment.go b/github/resource_github_repository_environment.go index 4b792310f5..ab13a4600d 100644 --- a/github/resource_github_repository_environment.go +++ b/github/resource_github_repository_environment.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_repository_file.go b/github/resource_github_repository_file.go index 17777114e8..5bd065cdfc 100644 --- a/github/resource_github_repository_file.go +++ b/github/resource_github_repository_file.go @@ -7,7 +7,7 @@ import ( "fmt" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_repository_milestone.go b/github/resource_github_repository_milestone.go index 338db02bbf..822176cb3f 100644 --- a/github/resource_github_repository_milestone.go +++ b/github/resource_github_repository_milestone.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_repository_project.go b/github/resource_github_repository_project.go index 9484a0d2d8..a239fbe2b8 100644 --- a/github/resource_github_repository_project.go +++ b/github/resource_github_repository_project.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_repository_pull_request.go b/github/resource_github_repository_pull_request.go index ac81497d30..84e9773223 100644 --- a/github/resource_github_repository_pull_request.go +++ b/github/resource_github_repository_pull_request.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_repository_webhook.go b/github/resource_github_repository_webhook.go index 1894798541..7f86c48a05 100644 --- a/github/resource_github_repository_webhook.go +++ b/github/resource_github_repository_webhook.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_team.go b/github/resource_github_team.go index d55f328e73..78b7b9d004 100644 --- a/github/resource_github_team.go +++ b/github/resource_github_team.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/shurcooL/githubv4" diff --git a/github/resource_github_team_membership.go b/github/resource_github_team_membership.go index 9006552713..f7bbdcf746 100644 --- a/github/resource_github_team_membership.go +++ b/github/resource_github_team_membership.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_team_membership_test.go b/github/resource_github_team_membership_test.go index 82fde04e86..b80aa03a47 100644 --- a/github/resource_github_team_membership_test.go +++ b/github/resource_github_team_membership_test.go @@ -7,7 +7,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" diff --git a/github/resource_github_team_repository.go b/github/resource_github_team_repository.go index f650372031..0fcd354023 100644 --- a/github/resource_github_team_repository.go +++ b/github/resource_github_team_repository.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_team_sync_group_mapping.go b/github/resource_github_team_sync_group_mapping.go index 2b0e74cc24..351935ab6e 100644 --- a/github/resource_github_team_sync_group_mapping.go +++ b/github/resource_github_team_sync_group_mapping.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_team_sync_group_mapping_test.go b/github/resource_github_team_sync_group_mapping_test.go index 8f861c6e41..12b0bc3de0 100644 --- a/github/resource_github_team_sync_group_mapping_test.go +++ b/github/resource_github_team_sync_group_mapping_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" diff --git a/github/resource_github_user_gpg_key.go b/github/resource_github_user_gpg_key.go index 77a3994950..fcffcb47ea 100644 --- a/github/resource_github_user_gpg_key.go +++ b/github/resource_github_user_gpg_key.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_user_ssh_key.go b/github/resource_github_user_ssh_key.go index 574f7a36e5..901970b6df 100644 --- a/github/resource_github_user_ssh_key.go +++ b/github/resource_github_user_ssh_key.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_organization_block.go b/github/resource_organization_block.go index ec5d8aec70..947927b14a 100644 --- a/github/resource_organization_block.go +++ b/github/resource_organization_block.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/transport.go b/github/transport.go index 130211c9eb..01ff46e93e 100644 --- a/github/transport.go +++ b/github/transport.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" ) const ( diff --git a/github/transport_test.go b/github/transport_test.go index eb050c36ba..96f8fdb052 100644 --- a/github/transport_test.go +++ b/github/transport_test.go @@ -10,7 +10,7 @@ import ( "net/url" "testing" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" ) func TestEtagTransport(t *testing.T) { diff --git a/github/util_permissions.go b/github/util_permissions.go index eb9a508dbb..62eafa561c 100644 --- a/github/util_permissions.go +++ b/github/util_permissions.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" ) const ( diff --git a/go.mod b/go.mod index 302b9bb39c..ccf4a17c02 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/client9/misspell v0.3.4 github.com/golangci/golangci-lint v1.25.1 - github.com/google/go-github/v39 v39.0.0 + github.com/google/go-github/v41 v41.0.0 github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02 // indirect github.com/hashicorp/hcl/v2 v2.3.0 // indirect github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 // indirect diff --git a/go.sum b/go.sum index 16fa5a0c12..3c606b8f48 100644 --- a/go.sum +++ b/go.sum @@ -157,12 +157,8 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github/v38 v38.1.0 h1:C6h1FkaITcBFK7gAmq4eFzt6gbhEhk7L5z6R3Uva+po= -github.com/google/go-github/v38 v38.1.0/go.mod h1:cStvrz/7nFr0FoENgG6GLbp53WaelXucT+BBz/3VKx4= -github.com/google/go-github/v39 v39.0.0 h1:pygGA5ySwxEez1N39GnDauD0PaWWuGgayudyZAc941s= -github.com/google/go-github/v39 v39.0.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= -github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= +github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= @@ -461,8 +457,6 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d h1:1ZiEyfaQIg3Qh0EoqpwAakHVhecoE5wlSg5GjnafJGw= -golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -497,7 +491,6 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -531,15 +524,14 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e h1:N7DeIrjYszNmSW409R3frPPwglRwMkXSBzwVbkOjLLA= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -587,7 +579,6 @@ google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEn google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= diff --git a/vendor/github.com/google/go-github/v39/AUTHORS b/vendor/github.com/google/go-github/v41/AUTHORS similarity index 99% rename from vendor/github.com/google/go-github/v39/AUTHORS rename to vendor/github.com/google/go-github/v41/AUTHORS index 2ae016f68c..80bd26dd4f 100644 --- a/vendor/github.com/google/go-github/v39/AUTHORS +++ b/vendor/github.com/google/go-github/v41/AUTHORS @@ -155,6 +155,7 @@ ishan upadhyay isqua Jacob Valdemar Jake Krammer +Jake White Jameel Haffejee James Cockbain James Loh @@ -353,4 +354,4 @@ Yosuke Akatsuka Yumikiyo Osanai Yusuke Kuoka Zach Latta -zhouhaibing089 +zhouhaibing089 \ No newline at end of file diff --git a/vendor/github.com/google/go-github/v39/LICENSE b/vendor/github.com/google/go-github/v41/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/v39/LICENSE rename to vendor/github.com/google/go-github/v41/LICENSE diff --git a/vendor/github.com/google/go-github/v39/github/actions.go b/vendor/github.com/google/go-github/v41/github/actions.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/actions.go rename to vendor/github.com/google/go-github/v41/github/actions.go diff --git a/vendor/github.com/google/go-github/v39/github/actions_artifacts.go b/vendor/github.com/google/go-github/v41/github/actions_artifacts.go similarity index 97% rename from vendor/github.com/google/go-github/v39/github/actions_artifacts.go rename to vendor/github.com/google/go-github/v41/github/actions_artifacts.go index 016ce7a121..4aa7dc4404 100644 --- a/vendor/github.com/google/go-github/v39/github/actions_artifacts.go +++ b/vendor/github.com/google/go-github/v41/github/actions_artifacts.go @@ -16,7 +16,7 @@ import ( // data between jobs in a workflow and provide storage for data // once a workflow is complete. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/artifacts/ +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#artifacts type Artifact struct { ID *int64 `json:"id,omitempty"` NodeID *string `json:"node_id,omitempty"` @@ -30,7 +30,7 @@ type Artifact struct { // ArtifactList represents a list of GitHub artifacts. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/artifacts/ +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#artifacts type ArtifactList struct { TotalCount *int64 `json:"total_count,omitempty"` Artifacts []*Artifact `json:"artifacts,omitempty"` @@ -106,7 +106,7 @@ func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, ar // DownloadArtifact gets a redirect URL to download an archive for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/artifacts/#download-an-artifact +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#download-an-artifact func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v/zip", owner, repo, artifactID) diff --git a/vendor/github.com/google/go-github/v39/github/actions_runner_groups.go b/vendor/github.com/google/go-github/v41/github/actions_runner_groups.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/actions_runner_groups.go rename to vendor/github.com/google/go-github/v41/github/actions_runner_groups.go diff --git a/vendor/github.com/google/go-github/v39/github/actions_runners.go b/vendor/github.com/google/go-github/v41/github/actions_runners.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/actions_runners.go rename to vendor/github.com/google/go-github/v41/github/actions_runners.go diff --git a/vendor/github.com/google/go-github/v39/github/actions_secrets.go b/vendor/github.com/google/go-github/v41/github/actions_secrets.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/actions_secrets.go rename to vendor/github.com/google/go-github/v41/github/actions_secrets.go diff --git a/vendor/github.com/google/go-github/v39/github/actions_workflow_jobs.go b/vendor/github.com/google/go-github/v41/github/actions_workflow_jobs.go similarity index 93% rename from vendor/github.com/google/go-github/v39/github/actions_workflow_jobs.go rename to vendor/github.com/google/go-github/v41/github/actions_workflow_jobs.go index 1102a756a5..66b8ff6edb 100644 --- a/vendor/github.com/google/go-github/v39/github/actions_workflow_jobs.go +++ b/vendor/github.com/google/go-github/v41/github/actions_workflow_jobs.go @@ -38,6 +38,12 @@ type WorkflowJob struct { Name *string `json:"name,omitempty"` Steps []*TaskStep `json:"steps,omitempty"` CheckRunURL *string `json:"check_run_url,omitempty"` + // Labels represents runner labels from the `runs-on:` key from a GitHub Actions workflow. + Labels []string `json:"labels,omitempty"` + RunnerID *int64 `json:"runner_id,omitempty"` + RunnerName *string `json:"runner_name,omitempty"` + RunnerGroupID *int64 `json:"runner_group_id,omitempty"` + RunnerGroupName *string `json:"runner_group_name,omitempty"` } // Jobs represents a slice of repository action workflow job. @@ -145,5 +151,4 @@ func (s *ActionsService) getWorkflowLogsFromURL(ctx context.Context, u string, f resp, err = s.getWorkflowLogsFromURL(ctx, u, false) } return resp, err - } diff --git a/vendor/github.com/google/go-github/v39/github/actions_workflow_runs.go b/vendor/github.com/google/go-github/v41/github/actions_workflow_runs.go similarity index 74% rename from vendor/github.com/google/go-github/v39/github/actions_workflow_runs.go rename to vendor/github.com/google/go-github/v41/github/actions_workflow_runs.go index b2c40d47c5..2c90956c26 100644 --- a/vendor/github.com/google/go-github/v39/github/actions_workflow_runs.go +++ b/vendor/github.com/google/go-github/v41/github/actions_workflow_runs.go @@ -14,31 +14,33 @@ import ( // WorkflowRun represents a repository action workflow run. type WorkflowRun struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - NodeID *string `json:"node_id,omitempty"` - HeadBranch *string `json:"head_branch,omitempty"` - HeadSHA *string `json:"head_sha,omitempty"` - RunNumber *int `json:"run_number,omitempty"` - Event *string `json:"event,omitempty"` - Status *string `json:"status,omitempty"` - Conclusion *string `json:"conclusion,omitempty"` - WorkflowID *int64 `json:"workflow_id,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - PullRequests []*PullRequest `json:"pull_requests,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - JobsURL *string `json:"jobs_url,omitempty"` - LogsURL *string `json:"logs_url,omitempty"` - CheckSuiteURL *string `json:"check_suite_url,omitempty"` - ArtifactsURL *string `json:"artifacts_url,omitempty"` - CancelURL *string `json:"cancel_url,omitempty"` - RerunURL *string `json:"rerun_url,omitempty"` - HeadCommit *HeadCommit `json:"head_commit,omitempty"` - WorkflowURL *string `json:"workflow_url,omitempty"` - Repository *Repository `json:"repository,omitempty"` - HeadRepository *Repository `json:"head_repository,omitempty"` + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + NodeID *string `json:"node_id,omitempty"` + HeadBranch *string `json:"head_branch,omitempty"` + HeadSHA *string `json:"head_sha,omitempty"` + RunNumber *int `json:"run_number,omitempty"` + Event *string `json:"event,omitempty"` + Status *string `json:"status,omitempty"` + Conclusion *string `json:"conclusion,omitempty"` + WorkflowID *int64 `json:"workflow_id,omitempty"` + CheckSuiteID *int64 `json:"check_suite_id,omitempty"` + CheckSuiteNodeID *string `json:"check_suite_node_id,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + PullRequests []*PullRequest `json:"pull_requests,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + JobsURL *string `json:"jobs_url,omitempty"` + LogsURL *string `json:"logs_url,omitempty"` + CheckSuiteURL *string `json:"check_suite_url,omitempty"` + ArtifactsURL *string `json:"artifacts_url,omitempty"` + CancelURL *string `json:"cancel_url,omitempty"` + RerunURL *string `json:"rerun_url,omitempty"` + HeadCommit *HeadCommit `json:"head_commit,omitempty"` + WorkflowURL *string `json:"workflow_url,omitempty"` + Repository *Repository `json:"repository,omitempty"` + HeadRepository *Repository `json:"head_repository,omitempty"` } // WorkflowRuns represents a slice of repository action workflow run. @@ -72,8 +74,15 @@ type WorkflowRunEnvironment struct { // WorkflowRunBill specifies billable time for a specific environment in a workflow run. type WorkflowRunBill struct { - TotalMS *int64 `json:"total_ms,omitempty"` - Jobs *int `json:"jobs,omitempty"` + TotalMS *int64 `json:"total_ms,omitempty"` + Jobs *int `json:"jobs,omitempty"` + JobRuns []*WorkflowRunJobRun `json:"job_runs,omitempty"` +} + +// WorkflowRunJobRun represents a usage of individual jobs of a specific workflow run. +type WorkflowRunJobRun struct { + JobID *int `json:"job_id,omitempty"` + DurationMS *int64 `json:"duration_ms,omitempty"` } func (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { @@ -202,6 +211,20 @@ func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo str return parsedURL, newResponse(resp), err } +// DeleteWorkflowRun deletes a workflow run by ID. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/actions#delete-a-workflow-run +func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo string, runID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runs/%v", owner, repo, runID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + // DeleteWorkflowRunLogs deletes all logs for a workflow run. // // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#delete-workflow-run-logs diff --git a/vendor/github.com/google/go-github/v39/github/actions_workflows.go b/vendor/github.com/google/go-github/v41/github/actions_workflows.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/actions_workflows.go rename to vendor/github.com/google/go-github/v41/github/actions_workflows.go diff --git a/vendor/github.com/google/go-github/v39/github/activity.go b/vendor/github.com/google/go-github/v41/github/activity.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/activity.go rename to vendor/github.com/google/go-github/v41/github/activity.go diff --git a/vendor/github.com/google/go-github/v39/github/activity_events.go b/vendor/github.com/google/go-github/v41/github/activity_events.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/activity_events.go rename to vendor/github.com/google/go-github/v41/github/activity_events.go diff --git a/vendor/github.com/google/go-github/v39/github/activity_notifications.go b/vendor/github.com/google/go-github/v41/github/activity_notifications.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/activity_notifications.go rename to vendor/github.com/google/go-github/v41/github/activity_notifications.go diff --git a/vendor/github.com/google/go-github/v39/github/activity_star.go b/vendor/github.com/google/go-github/v41/github/activity_star.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/activity_star.go rename to vendor/github.com/google/go-github/v41/github/activity_star.go diff --git a/vendor/github.com/google/go-github/v39/github/activity_watching.go b/vendor/github.com/google/go-github/v41/github/activity_watching.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/activity_watching.go rename to vendor/github.com/google/go-github/v41/github/activity_watching.go diff --git a/vendor/github.com/google/go-github/v39/github/admin.go b/vendor/github.com/google/go-github/v41/github/admin.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/admin.go rename to vendor/github.com/google/go-github/v41/github/admin.go diff --git a/vendor/github.com/google/go-github/v39/github/admin_orgs.go b/vendor/github.com/google/go-github/v41/github/admin_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/admin_orgs.go rename to vendor/github.com/google/go-github/v41/github/admin_orgs.go diff --git a/vendor/github.com/google/go-github/v39/github/admin_stats.go b/vendor/github.com/google/go-github/v41/github/admin_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/admin_stats.go rename to vendor/github.com/google/go-github/v41/github/admin_stats.go diff --git a/vendor/github.com/google/go-github/v39/github/admin_users.go b/vendor/github.com/google/go-github/v41/github/admin_users.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/admin_users.go rename to vendor/github.com/google/go-github/v41/github/admin_users.go diff --git a/vendor/github.com/google/go-github/v39/github/apps.go b/vendor/github.com/google/go-github/v41/github/apps.go similarity index 98% rename from vendor/github.com/google/go-github/v39/github/apps.go rename to vendor/github.com/google/go-github/v41/github/apps.go index 8b850d9e5d..3823a12196 100644 --- a/vendor/github.com/google/go-github/v39/github/apps.go +++ b/vendor/github.com/google/go-github/v41/github/apps.go @@ -47,6 +47,10 @@ type InstallationTokenOptions struct { // Providing repository IDs restricts the access of an installation token to specific repositories. RepositoryIDs []int64 `json:"repository_ids,omitempty"` + // The names of the repositories that the installation token can access. + // Providing repository names restricts the access of an installation token to specific repositories. + Repositories []string `json:"repositories,omitempty"` + // The permissions granted to the access token. // The permissions object includes the permission names and their access type. Permissions *InstallationPermissions `json:"permissions,omitempty"` diff --git a/vendor/github.com/google/go-github/v41/github/apps_hooks.go b/vendor/github.com/google/go-github/v41/github/apps_hooks.go new file mode 100644 index 0000000000..ed8396f442 --- /dev/null +++ b/vendor/github.com/google/go-github/v41/github/apps_hooks.go @@ -0,0 +1,48 @@ +// Copyright 2021 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" +) + +// GetHookConfig returns the webhook configuration for a GitHub App. +// The underlying transport must be authenticated as an app. +// +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps#get-a-webhook-configuration-for-an-app +func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response, error) { + req, err := s.client.NewRequest("GET", "app/hook/config", nil) + if err != nil { + return nil, nil, err + } + + config := new(HookConfig) + resp, err := s.client.Do(ctx, req, &config) + if err != nil { + return nil, resp, err + } + + return config, resp, nil +} + +// UpdateHookConfig updates the webhook configuration for a GitHub App. +// The underlying transport must be authenticated as an app. +// +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps#update-a-webhook-configuration-for-an-app +func (s *AppsService) UpdateHookConfig(ctx context.Context, config *HookConfig) (*HookConfig, *Response, error) { + req, err := s.client.NewRequest("PATCH", "app/hook/config", config) + if err != nil { + return nil, nil, err + } + + c := new(HookConfig) + resp, err := s.client.Do(ctx, req, c) + if err != nil { + return nil, resp, err + } + + return c, resp, nil +} diff --git a/vendor/github.com/google/go-github/v39/github/apps_installation.go b/vendor/github.com/google/go-github/v41/github/apps_installation.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/apps_installation.go rename to vendor/github.com/google/go-github/v41/github/apps_installation.go diff --git a/vendor/github.com/google/go-github/v39/github/apps_manifest.go b/vendor/github.com/google/go-github/v41/github/apps_manifest.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/apps_manifest.go rename to vendor/github.com/google/go-github/v41/github/apps_manifest.go diff --git a/vendor/github.com/google/go-github/v39/github/apps_marketplace.go b/vendor/github.com/google/go-github/v41/github/apps_marketplace.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v41/github/apps_marketplace.go diff --git a/vendor/github.com/google/go-github/v39/github/authorizations.go b/vendor/github.com/google/go-github/v41/github/authorizations.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/authorizations.go rename to vendor/github.com/google/go-github/v41/github/authorizations.go diff --git a/vendor/github.com/google/go-github/v39/github/billing.go b/vendor/github.com/google/go-github/v41/github/billing.go similarity index 68% rename from vendor/github.com/google/go-github/v39/github/billing.go rename to vendor/github.com/google/go-github/v41/github/billing.go index fa0e034d0f..12a79fa60a 100644 --- a/vendor/github.com/google/go-github/v39/github/billing.go +++ b/vendor/github.com/google/go-github/v41/github/billing.go @@ -39,9 +39,28 @@ type PackageBilling struct { // StorageBilling represents a GitHub Storage billing. type StorageBilling struct { - DaysLeftInBillingCycle int `json:"days_left_in_billing_cycle"` - EstimatedPaidStorageForMonth int `json:"estimated_paid_storage_for_month"` - EstimatedStorageForMonth int `json:"estimated_storage_for_month"` + DaysLeftInBillingCycle int `json:"days_left_in_billing_cycle"` + EstimatedPaidStorageForMonth float64 `json:"estimated_paid_storage_for_month"` + EstimatedStorageForMonth int `json:"estimated_storage_for_month"` +} + +// ActiveCommitters represents the total active committers across all repositories in an Organization. +type ActiveCommitters struct { + TotalAdvancedSecurityCommitters int `json:"total_advanced_security_committers"` + Repositories []*RepositoryActiveCommitters `json:"repositories,omitempty"` +} + +// RepositoryActiveCommitters represents active committers on each repository. +type RepositoryActiveCommitters struct { + Name *string `json:"name,omitempty"` + AdvancedSecurityCommitters *int `json:"advanced_security_committers,omitempty"` + AdvancedSecurityCommittersBreakdown []*AdvancedSecurityCommittersBreakdown `json:"advanced_security_committers_breakdown,omitempty"` +} + +// AdvancedSecurityCommittersBreakdown represents the user activity breakdown for ActiveCommitters. +type AdvancedSecurityCommittersBreakdown struct { + UserLogin *string `json:"user_login,omitempty"` + LastPushedDate *string `json:"last_pushed_date,omitempty"` } // GetActionsBillingOrg returns the summary of the free and paid GitHub Actions minutes used for an Org. @@ -53,8 +72,13 @@ func (s *BillingService) GetActionsBillingOrg(ctx context.Context, org string) ( if err != nil { return nil, nil, err } + actionsOrgBilling := new(ActionBilling) resp, err := s.client.Do(ctx, req, actionsOrgBilling) + if err != nil { + return nil, resp, err + } + return actionsOrgBilling, resp, err } @@ -67,8 +91,13 @@ func (s *BillingService) GetPackagesBillingOrg(ctx context.Context, org string) if err != nil { return nil, nil, err } + packagesOrgBilling := new(PackageBilling) resp, err := s.client.Do(ctx, req, packagesOrgBilling) + if err != nil { + return nil, resp, err + } + return packagesOrgBilling, resp, err } @@ -82,11 +111,35 @@ func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) ( if err != nil { return nil, nil, err } + storageOrgBilling := new(StorageBilling) resp, err := s.client.Do(ctx, req, storageOrgBilling) + if err != nil { + return nil, resp, err + } + return storageOrgBilling, resp, err } +// GetAdvancedSecurityActiveCommittersOrg returns the GitHub Advanced Security active committers for an organization per repository. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/billing#get-github-advanced-security-active-committers-for-an-organization +func (s *BillingService) GetAdvancedSecurityActiveCommittersOrg(ctx context.Context, org string) (*ActiveCommitters, *Response, error) { + u := fmt.Sprintf("orgs/%v/settings/billing/advanced-security", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + activeOrgCommitters := new(ActiveCommitters) + resp, err := s.client.Do(ctx, req, activeOrgCommitters) + if err != nil { + return nil, resp, err + } + + return activeOrgCommitters, resp, err +} + // GetActionsBillingUser returns the summary of the free and paid GitHub Actions minutes used for a user. // // GitHub API docs: https://docs.github.com/en/rest/reference/billing#get-github-actions-billing-for-a-user @@ -96,8 +149,13 @@ func (s *BillingService) GetActionsBillingUser(ctx context.Context, user string) if err != nil { return nil, nil, err } + actionsUserBilling := new(ActionBilling) resp, err := s.client.Do(ctx, req, actionsUserBilling) + if err != nil { + return nil, resp, err + } + return actionsUserBilling, resp, err } @@ -110,8 +168,13 @@ func (s *BillingService) GetPackagesBillingUser(ctx context.Context, user string if err != nil { return nil, nil, err } + packagesUserBilling := new(PackageBilling) resp, err := s.client.Do(ctx, req, packagesUserBilling) + if err != nil { + return nil, resp, err + } + return packagesUserBilling, resp, err } @@ -125,7 +188,12 @@ func (s *BillingService) GetStorageBillingUser(ctx context.Context, user string) if err != nil { return nil, nil, err } + storageUserBilling := new(StorageBilling) resp, err := s.client.Do(ctx, req, storageUserBilling) + if err != nil { + return nil, resp, err + } + return storageUserBilling, resp, err } diff --git a/vendor/github.com/google/go-github/v39/github/checks.go b/vendor/github.com/google/go-github/v41/github/checks.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/checks.go rename to vendor/github.com/google/go-github/v41/github/checks.go diff --git a/vendor/github.com/google/go-github/v39/github/code-scanning.go b/vendor/github.com/google/go-github/v41/github/code-scanning.go similarity index 79% rename from vendor/github.com/google/go-github/v39/github/code-scanning.go rename to vendor/github.com/google/go-github/v41/github/code-scanning.go index dbaeb346b3..4508c3390d 100644 --- a/vendor/github.com/google/go-github/v39/github/code-scanning.go +++ b/vendor/github.com/google/go-github/v41/github/code-scanning.go @@ -115,6 +115,28 @@ type AlertListOptions struct { // Return code scanning alerts for a specific branch reference. The ref must be formatted as heads/. Ref string `url:"ref,omitempty"` + + ListOptions +} + +// SarifAnalysis specifies the results of a code scanning job. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#upload-an-analysis-as-sarif-data +type SarifAnalysis struct { + CommitSHA *string `json:"commit_sha,omitempty"` + Ref *string `json:"ref,omitempty"` + Sarif *string `json:"sarif,omitempty"` + CheckoutURI *string `json:"checkout_uri,omitempty"` + StartedAt *Timestamp `json:"started_at,omitempty"` + ToolName *string `json:"tool_name,omitempty"` +} + +// SarifID identifies a sarif analysis upload. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#upload-an-analysis-as-sarif-data +type SarifID struct { + ID *string `json:"id,omitempty"` + URL *string `json:"url,omitempty"` } // ListAlertsForRepo lists code scanning alerts for a repository. @@ -169,3 +191,27 @@ func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, return a, resp, nil } + +// UploadSarif uploads the result of code scanning job to GitHub. +// +// For the parameter sarif, you must first compress your SARIF file using gzip and then translate the contents of the file into a Base64 encoding string. +// You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events +// write permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#upload-an-analysis-as-sarif-data +func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo string, sarif *SarifAnalysis) (*SarifID, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs", owner, repo) + + req, err := s.client.NewRequest("POST", u, sarif) + if err != nil { + return nil, nil, err + } + + sarifID := new(SarifID) + resp, err := s.client.Do(ctx, req, sarifID) + if err != nil { + return nil, resp, err + } + + return sarifID, resp, nil +} diff --git a/vendor/github.com/google/go-github/v39/github/doc.go b/vendor/github.com/google/go-github/v41/github/doc.go similarity index 91% rename from vendor/github.com/google/go-github/v39/github/doc.go rename to vendor/github.com/google/go-github/v41/github/doc.go index 4465874117..d67e286973 100644 --- a/vendor/github.com/google/go-github/v39/github/doc.go +++ b/vendor/github.com/google/go-github/v41/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v39/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v41/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to @@ -73,6 +73,10 @@ BasicAuthTransport. GitHub Apps authentication can be provided by the https://github.com/bradleyfalzon/ghinstallation package. +It supports both authentication as an installation, using an installation access token, +and as an app, using a JWT. + +To authenticate as an installation: import "github.com/bradleyfalzon/ghinstallation" @@ -89,6 +93,23 @@ https://github.com/bradleyfalzon/ghinstallation package. // Use client... } +To authenticate as an app, using a JWT: + + import "github.com/bradleyfalzon/ghinstallation" + + func main() { + // Wrap the shared transport for use with the application ID 1. + atr, err := ghinstallation.NewAppsTransportKeyFromFile(http.DefaultTransport, 1, "2016-10-19.private-key.pem") + if err != nil { + // Handle error. + } + + // Use app transport with client + client := github.NewClient(&http.Client{Transport: atr}) + + // Use client... + } + Rate Limiting GitHub imposes a rate limit on all API clients. Unauthenticated clients are diff --git a/vendor/github.com/google/go-github/v39/github/enterprise.go b/vendor/github.com/google/go-github/v41/github/enterprise.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/enterprise.go rename to vendor/github.com/google/go-github/v41/github/enterprise.go diff --git a/vendor/github.com/google/go-github/v39/github/enterprise_actions_runners.go b/vendor/github.com/google/go-github/v41/github/enterprise_actions_runners.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/enterprise_actions_runners.go rename to vendor/github.com/google/go-github/v41/github/enterprise_actions_runners.go diff --git a/vendor/github.com/google/go-github/v39/github/enterprise_audit_log.go b/vendor/github.com/google/go-github/v41/github/enterprise_audit_log.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/enterprise_audit_log.go rename to vendor/github.com/google/go-github/v41/github/enterprise_audit_log.go diff --git a/vendor/github.com/google/go-github/v39/github/event.go b/vendor/github.com/google/go-github/v41/github/event.go similarity index 98% rename from vendor/github.com/google/go-github/v39/github/event.go rename to vendor/github.com/google/go-github/v41/github/event.go index 8f1a0f2eea..9241d0286d 100644 --- a/vendor/github.com/google/go-github/v39/github/event.go +++ b/vendor/github.com/google/go-github/v41/github/event.go @@ -30,6 +30,8 @@ func (e Event) String() string { // a value of the corresponding struct type will be returned. func (e *Event) ParsePayload() (payload interface{}, err error) { switch *e.Type { + case "BranchProtectionRuleEvent": + payload = &BranchProtectionRuleEvent{} case "CheckRunEvent": payload = &CheckRunEvent{} case "CheckSuiteEvent": diff --git a/vendor/github.com/google/go-github/v39/github/event_types.go b/vendor/github.com/google/go-github/v41/github/event_types.go similarity index 94% rename from vendor/github.com/google/go-github/v39/github/event_types.go rename to vendor/github.com/google/go-github/v41/github/event_types.go index 384aa3a1e5..5c81115877 100644 --- a/vendor/github.com/google/go-github/v39/github/event_types.go +++ b/vendor/github.com/google/go-github/v41/github/event_types.go @@ -15,6 +15,19 @@ type RequestedAction struct { Identifier string `json:"identifier"` // The integrator reference of the action requested by the user. } +// BranchProtectionRuleEvent triggered when a check suite is "created", "edited", or "deleted". +// The Webhook event name is "branch_protection_rule". +// +// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_rule +type BranchProtectionRuleEvent struct { + Action *string `json:"action,omitempty"` + Rule *BranchProtectionRule `json:"rule,omitempty"` + Changes *ProtectionChanges `json:"changes,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` +} + // CheckRunEvent is triggered when a check run is "created", "completed", or "rerequested". // The Webhook event name is "check_run". // @@ -130,6 +143,9 @@ type DeployKeyEvent struct { // The deploy key resource. Key *Key `json:"key,omitempty"` + + // The following fields are only populated by Webhook events. + Installation *Installation `json:"installation,omitempty"` } // DeploymentEvent represents a deployment. @@ -186,7 +202,8 @@ type GitHubAppAuthorizationEvent struct { Action *string `json:"action,omitempty"` // The following fields are only populated by Webhook events. - Sender *User `json:"sender,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` } // Page represents a single Wiki page. @@ -367,6 +384,10 @@ type IssueCommentEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // IssuesEvent is triggered when an issue is opened, edited, deleted, transferred, @@ -478,6 +499,9 @@ type MetaEvent struct { // This will contain different keys based on the type of webhook it is: repository, // organization, business, app, or GitHub Marketplace. Hook *Hook `json:"hook,omitempty"` + + // The following fields are only populated by Webhook events. + Installation *Installation `json:"installation,omitempty"` } // MilestoneEvent is triggered when a milestone is created, closed, opened, edited, or deleted. @@ -551,6 +575,9 @@ type PackageEvent struct { Repo *Repository `json:"repository,omitempty"` Org *Organization `json:"organization,omitempty"` Sender *User `json:"sender,omitempty"` + + // The following fields are only populated by Webhook events. + Installation *Installation `json:"installation,omitempty"` } // PageBuildEvent represents an attempted build of a GitHub Pages site, whether @@ -796,6 +823,10 @@ type PushEvent struct { Pusher *User `json:"pusher,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } func (p PushEvent) String() string { @@ -939,6 +970,9 @@ type RepositoryVulnerabilityAlertEvent struct { //The repository of the vulnerable dependency. Repository *Repository `json:"repository,omitempty"` + + // The following fields are only populated by Webhook events. + Installation *Installation `json:"installation,omitempty"` } // RepositoryVulnerabilityAlert represents a repository security alert. @@ -969,9 +1003,10 @@ type StarEvent struct { StarredAt *Timestamp `json:"starred_at,omitempty"` // The following fields are only populated by Webhook events. - Org *Organization `json:"organization,omitempty"` - Repo *Repository `json:"repository,omitempty"` - Sender *User `json:"sender,omitempty"` + Org *Organization `json:"organization,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` } // StatusEvent is triggered when the status of a Git commit changes. @@ -1049,6 +1084,9 @@ type UserEvent struct { Action *string `json:"action,omitempty"` Enterprise *Enterprise `json:"enterprise,omitempty"` Sender *User `json:"sender,omitempty"` + + // The following fields are only populated by Webhook events. + Installation *Installation `json:"installation,omitempty"` } // WatchEvent is related to starring a repository, not watching. See this API @@ -1078,23 +1116,28 @@ type WorkflowDispatchEvent struct { Workflow *string `json:"workflow,omitempty"` // The following fields are only populated by Webhook events. - Repo *Repository `json:"repository,omitempty"` - Org *Organization `json:"organization,omitempty"` - Sender *User `json:"sender,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` } // WorkflowJobEvent is triggered when a job is queued, started or completed. // -// GitHub API docs: pending +// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_job type WorkflowJobEvent struct { WorkflowJob *WorkflowJob `json:"workflow_job,omitempty"` Action *string `json:"action,omitempty"` // The following fields are only populated by Webhook events. - Org *Organization `json:"organization,omitempty"` - Repo *Repository `json:"repository,omitempty"` - Sender *User `json:"sender,omitempty"` + + // Org is not nil when the webhook is configured for an organization or the event + // occurs from activity in a repository owned by an organization. + Org *Organization `json:"organization,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` } // WorkflowRunEvent is triggered when a GitHub Actions workflow run is requested or completed. @@ -1106,7 +1149,8 @@ type WorkflowRunEvent struct { WorkflowRun *WorkflowRun `json:"workflow_run,omitempty"` // The following fields are only populated by Webhook events. - Org *Organization `json:"organization,omitempty"` - Repo *Repository `json:"repository,omitempty"` - Sender *User `json:"sender,omitempty"` + Org *Organization `json:"organization,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` } diff --git a/vendor/github.com/google/go-github/v39/github/gists.go b/vendor/github.com/google/go-github/v41/github/gists.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/gists.go rename to vendor/github.com/google/go-github/v41/github/gists.go diff --git a/vendor/github.com/google/go-github/v39/github/gists_comments.go b/vendor/github.com/google/go-github/v41/github/gists_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/gists_comments.go rename to vendor/github.com/google/go-github/v41/github/gists_comments.go diff --git a/vendor/github.com/google/go-github/v39/github/git.go b/vendor/github.com/google/go-github/v41/github/git.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/git.go rename to vendor/github.com/google/go-github/v41/github/git.go diff --git a/vendor/github.com/google/go-github/v39/github/git_blobs.go b/vendor/github.com/google/go-github/v41/github/git_blobs.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/git_blobs.go rename to vendor/github.com/google/go-github/v41/github/git_blobs.go diff --git a/vendor/github.com/google/go-github/v39/github/git_commits.go b/vendor/github.com/google/go-github/v41/github/git_commits.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/git_commits.go rename to vendor/github.com/google/go-github/v41/github/git_commits.go diff --git a/vendor/github.com/google/go-github/v39/github/git_refs.go b/vendor/github.com/google/go-github/v41/github/git_refs.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/git_refs.go rename to vendor/github.com/google/go-github/v41/github/git_refs.go diff --git a/vendor/github.com/google/go-github/v39/github/git_tags.go b/vendor/github.com/google/go-github/v41/github/git_tags.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/git_tags.go rename to vendor/github.com/google/go-github/v41/github/git_tags.go diff --git a/vendor/github.com/google/go-github/v39/github/git_trees.go b/vendor/github.com/google/go-github/v41/github/git_trees.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/git_trees.go rename to vendor/github.com/google/go-github/v41/github/git_trees.go diff --git a/vendor/github.com/google/go-github/v39/github/github-accessors.go b/vendor/github.com/google/go-github/v41/github/github-accessors.go similarity index 95% rename from vendor/github.com/google/go-github/v39/github/github-accessors.go rename to vendor/github.com/google/go-github/v41/github/github-accessors.go index 8422d6a797..b6a846eff3 100644 --- a/vendor/github.com/google/go-github/v39/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v41/github/github-accessors.go @@ -148,6 +148,30 @@ func (a *AdminStats) GetUsers() *UserStats { return a.Users } +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (a *AdvancedSecurity) GetStatus() string { + if a == nil || a.Status == nil { + return "" + } + return *a.Status +} + +// GetLastPushedDate returns the LastPushedDate field if it's non-nil, zero value otherwise. +func (a *AdvancedSecurityCommittersBreakdown) GetLastPushedDate() string { + if a == nil || a.LastPushedDate == nil { + return "" + } + return *a.LastPushedDate +} + +// GetUserLogin returns the UserLogin field if it's non-nil, zero value otherwise. +func (a *AdvancedSecurityCommittersBreakdown) GetUserLogin() string { + if a == nil || a.UserLogin == nil { + return "" + } + return *a.UserLogin +} + // GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise. func (a *Alert) GetClosedAt() Timestamp { if a == nil || a.ClosedAt == nil { @@ -869,9 +893,9 @@ func (a *AuditEntry) GetRepositoryPublic() bool { } // GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRunnerGroupID() string { +func (a *AuditEntry) GetRunnerGroupID() int64 { if a == nil || a.RunnerGroupID == nil { - return "" + return 0 } return *a.RunnerGroupID } @@ -885,9 +909,9 @@ func (a *AuditEntry) GetRunnerGroupName() string { } // GetRunnerID returns the RunnerID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRunnerID() string { +func (a *AuditEntry) GetRunnerID() int64 { if a == nil || a.RunnerID == nil { - return "" + return 0 } return *a.RunnerID } @@ -1188,6 +1212,14 @@ func (a *AuthorizationUpdateRequest) GetNoteURL() string { return *a.NoteURL } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (a *AuthorizedActorsOnly) GetFrom() bool { + if a == nil || a.From == nil { + return false + } + return *a.From +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (a *Autolink) GetID() int64 { if a == nil || a.ID == nil { @@ -1364,6 +1396,230 @@ func (b *BranchPolicy) GetProtectedBranches() bool { return *b.ProtectedBranches } +// GetAdminEnforced returns the AdminEnforced field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetAdminEnforced() bool { + if b == nil || b.AdminEnforced == nil { + return false + } + return *b.AdminEnforced +} + +// GetAllowDeletionsEnforcementLevel returns the AllowDeletionsEnforcementLevel field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetAllowDeletionsEnforcementLevel() string { + if b == nil || b.AllowDeletionsEnforcementLevel == nil { + return "" + } + return *b.AllowDeletionsEnforcementLevel +} + +// GetAllowForcePushesEnforcementLevel returns the AllowForcePushesEnforcementLevel field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetAllowForcePushesEnforcementLevel() string { + if b == nil || b.AllowForcePushesEnforcementLevel == nil { + return "" + } + return *b.AllowForcePushesEnforcementLevel +} + +// GetAuthorizedActorsOnly returns the AuthorizedActorsOnly field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetAuthorizedActorsOnly() bool { + if b == nil || b.AuthorizedActorsOnly == nil { + return false + } + return *b.AuthorizedActorsOnly +} + +// GetAuthorizedDismissalActorsOnly returns the AuthorizedDismissalActorsOnly field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetAuthorizedDismissalActorsOnly() bool { + if b == nil || b.AuthorizedDismissalActorsOnly == nil { + return false + } + return *b.AuthorizedDismissalActorsOnly +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetCreatedAt() Timestamp { + if b == nil || b.CreatedAt == nil { + return Timestamp{} + } + return *b.CreatedAt +} + +// GetDismissStaleReviewsOnPush returns the DismissStaleReviewsOnPush field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetDismissStaleReviewsOnPush() bool { + if b == nil || b.DismissStaleReviewsOnPush == nil { + return false + } + return *b.DismissStaleReviewsOnPush +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetID() int64 { + if b == nil || b.ID == nil { + return 0 + } + return *b.ID +} + +// GetIgnoreApprovalsFromContributors returns the IgnoreApprovalsFromContributors field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetIgnoreApprovalsFromContributors() bool { + if b == nil || b.IgnoreApprovalsFromContributors == nil { + return false + } + return *b.IgnoreApprovalsFromContributors +} + +// GetLinearHistoryRequirementEnforcementLevel returns the LinearHistoryRequirementEnforcementLevel field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetLinearHistoryRequirementEnforcementLevel() string { + if b == nil || b.LinearHistoryRequirementEnforcementLevel == nil { + return "" + } + return *b.LinearHistoryRequirementEnforcementLevel +} + +// GetMergeQueueEnforcementLevel returns the MergeQueueEnforcementLevel field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetMergeQueueEnforcementLevel() string { + if b == nil || b.MergeQueueEnforcementLevel == nil { + return "" + } + return *b.MergeQueueEnforcementLevel +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetName() string { + if b == nil || b.Name == nil { + return "" + } + return *b.Name +} + +// GetPullRequestReviewsEnforcementLevel returns the PullRequestReviewsEnforcementLevel field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetPullRequestReviewsEnforcementLevel() string { + if b == nil || b.PullRequestReviewsEnforcementLevel == nil { + return "" + } + return *b.PullRequestReviewsEnforcementLevel +} + +// GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetRepositoryID() int64 { + if b == nil || b.RepositoryID == nil { + return 0 + } + return *b.RepositoryID +} + +// GetRequireCodeOwnerReview returns the RequireCodeOwnerReview field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetRequireCodeOwnerReview() bool { + if b == nil || b.RequireCodeOwnerReview == nil { + return false + } + return *b.RequireCodeOwnerReview +} + +// GetRequiredApprovingReviewCount returns the RequiredApprovingReviewCount field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetRequiredApprovingReviewCount() int { + if b == nil || b.RequiredApprovingReviewCount == nil { + return 0 + } + return *b.RequiredApprovingReviewCount +} + +// GetRequiredConversationResolutionLevel returns the RequiredConversationResolutionLevel field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetRequiredConversationResolutionLevel() string { + if b == nil || b.RequiredConversationResolutionLevel == nil { + return "" + } + return *b.RequiredConversationResolutionLevel +} + +// GetRequiredDeploymentsEnforcementLevel returns the RequiredDeploymentsEnforcementLevel field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetRequiredDeploymentsEnforcementLevel() string { + if b == nil || b.RequiredDeploymentsEnforcementLevel == nil { + return "" + } + return *b.RequiredDeploymentsEnforcementLevel +} + +// GetRequiredStatusChecksEnforcementLevel returns the RequiredStatusChecksEnforcementLevel field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetRequiredStatusChecksEnforcementLevel() string { + if b == nil || b.RequiredStatusChecksEnforcementLevel == nil { + return "" + } + return *b.RequiredStatusChecksEnforcementLevel +} + +// GetSignatureRequirementEnforcementLevel returns the SignatureRequirementEnforcementLevel field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetSignatureRequirementEnforcementLevel() string { + if b == nil || b.SignatureRequirementEnforcementLevel == nil { + return "" + } + return *b.SignatureRequirementEnforcementLevel +} + +// GetStrictRequiredStatusChecksPolicy returns the StrictRequiredStatusChecksPolicy field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetStrictRequiredStatusChecksPolicy() bool { + if b == nil || b.StrictRequiredStatusChecksPolicy == nil { + return false + } + return *b.StrictRequiredStatusChecksPolicy +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetUpdatedAt() Timestamp { + if b == nil || b.UpdatedAt == nil { + return Timestamp{} + } + return *b.UpdatedAt +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRuleEvent) GetAction() string { + if b == nil || b.Action == nil { + return "" + } + return *b.Action +} + +// GetChanges returns the Changes field. +func (b *BranchProtectionRuleEvent) GetChanges() *ProtectionChanges { + if b == nil { + return nil + } + return b.Changes +} + +// GetOrg returns the Org field. +func (b *BranchProtectionRuleEvent) GetOrg() *Organization { + if b == nil { + return nil + } + return b.Org +} + +// GetRepo returns the Repo field. +func (b *BranchProtectionRuleEvent) GetRepo() *Repository { + if b == nil { + return nil + } + return b.Repo +} + +// GetRule returns the Rule field. +func (b *BranchProtectionRuleEvent) GetRule() *BranchProtectionRule { + if b == nil { + return nil + } + return b.Rule +} + +// GetSender returns the Sender field. +func (b *BranchProtectionRuleEvent) GetSender() *User { + if b == nil { + return nil + } + return b.Sender +} + // GetApp returns the App field. func (c *CheckRun) GetApp() *App { if c == nil { @@ -3148,6 +3404,14 @@ func (d *DeployKeyEvent) GetAction() string { return *d.Action } +// GetInstallation returns the Installation field. +func (d *DeployKeyEvent) GetInstallation() *Installation { + if d == nil { + return nil + } + return d.Installation +} + // GetKey returns the Key field. func (d *DeployKeyEvent) GetKey() *Key { if d == nil { @@ -4276,6 +4540,22 @@ func (f *ForkEvent) GetSender() *User { return f.Sender } +// GetPreviousTagName returns the PreviousTagName field if it's non-nil, zero value otherwise. +func (g *GenerateNotesOptions) GetPreviousTagName() string { + if g == nil || g.PreviousTagName == nil { + return "" + } + return *g.PreviousTagName +} + +// GetTargetCommitish returns the TargetCommitish field if it's non-nil, zero value otherwise. +func (g *GenerateNotesOptions) GetTargetCommitish() string { + if g == nil || g.TargetCommitish == nil { + return "" + } + return *g.TargetCommitish +} + // GetInclude returns the Include field if it's non-nil, zero value otherwise. func (g *GetAuditLogOptions) GetInclude() string { if g == nil || g.Include == nil { @@ -4612,6 +4892,14 @@ func (g *GitHubAppAuthorizationEvent) GetAction() string { return *g.Action } +// GetInstallation returns the Installation field. +func (g *GitHubAppAuthorizationEvent) GetInstallation() *Installation { + if g == nil { + return nil + } + return g.Installation +} + // GetSender returns the Sender field. func (g *GitHubAppAuthorizationEvent) GetSender() *User { if g == nil { @@ -4988,6 +5276,14 @@ func (h *HookConfig) GetInsecureSSL() string { return *h.InsecureSSL } +// GetSecret returns the Secret field if it's non-nil, zero value otherwise. +func (h *HookConfig) GetSecret() string { + if h == nil || h.Secret == nil { + return "" + } + return *h.Secret +} + // GetURL returns the URL field if it's non-nil, zero value otherwise. func (h *HookConfig) GetURL() string { if h == nil || h.URL == nil { @@ -6316,6 +6612,14 @@ func (i *IssueCommentEvent) GetIssue() *Issue { return i.Issue } +// GetOrganization returns the Organization field. +func (i *IssueCommentEvent) GetOrganization() *Organization { + if i == nil { + return nil + } + return i.Organization +} + // GetRepo returns the Repo field. func (i *IssueCommentEvent) GetRepo() *Repository { if i == nil { @@ -7796,6 +8100,14 @@ func (m *MetaEvent) GetHookID() int64 { return *m.HookID } +// GetInstallation returns the Installation field. +func (m *MetaEvent) GetInstallation() *Installation { + if m == nil { + return nil + } + return m.Installation +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (m *Metric) GetHTMLURL() string { if m == nil || m.HTMLURL == nil { @@ -8956,6 +9268,14 @@ func (p *Package) GetRegistry() *PackageRegistry { return p.Registry } +// GetRepository returns the Repository field. +func (p *Package) GetRepository() *Repository { + if p == nil { + return nil + } + return p.Repository +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (p *Package) GetUpdatedAt() Timestamp { if p == nil || p.UpdatedAt == nil { @@ -8964,6 +9284,30 @@ func (p *Package) GetUpdatedAt() Timestamp { return *p.UpdatedAt } +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (p *Package) GetURL() string { + if p == nil || p.URL == nil { + return "" + } + return *p.URL +} + +// GetVersionCount returns the VersionCount field if it's non-nil, zero value otherwise. +func (p *Package) GetVersionCount() int64 { + if p == nil || p.VersionCount == nil { + return 0 + } + return *p.VersionCount +} + +// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. +func (p *Package) GetVisibility() string { + if p == nil || p.Visibility == nil { + return "" + } + return *p.Visibility +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *PackageEvent) GetAction() string { if p == nil || p.Action == nil { @@ -8972,6 +9316,14 @@ func (p *PackageEvent) GetAction() string { return *p.Action } +// GetInstallation returns the Installation field. +func (p *PackageEvent) GetInstallation() *Installation { + if p == nil { + return nil + } + return p.Installation +} + // GetOrg returns the Org field. func (p *PackageEvent) GetOrg() *Organization { if p == nil { @@ -9100,6 +9452,46 @@ func (p *PackageFile) GetUpdatedAt() Timestamp { return *p.UpdatedAt } +// GetPackageType returns the PackageType field if it's non-nil, zero value otherwise. +func (p *PackageListOptions) GetPackageType() string { + if p == nil || p.PackageType == nil { + return "" + } + return *p.PackageType +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (p *PackageListOptions) GetState() string { + if p == nil || p.State == nil { + return "" + } + return *p.State +} + +// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. +func (p *PackageListOptions) GetVisibility() string { + if p == nil || p.Visibility == nil { + return "" + } + return *p.Visibility +} + +// GetContainer returns the Container field. +func (p *PackageMetadata) GetContainer() *PackageContainerMetadata { + if p == nil { + return nil + } + return p.Container +} + +// GetPackageType returns the PackageType field if it's non-nil, zero value otherwise. +func (p *PackageMetadata) GetPackageType() string { + if p == nil || p.PackageType == nil { + return "" + } + return *p.PackageType +} + // GetAboutURL returns the AboutURL field if it's non-nil, zero value otherwise. func (p *PackageRegistry) GetAboutURL() string { if p == nil || p.AboutURL == nil { @@ -9300,6 +9692,30 @@ func (p *PackageVersion) GetManifest() string { return *p.Manifest } +// GetMetadata returns the Metadata field. +func (p *PackageVersion) GetMetadata() *PackageMetadata { + if p == nil { + return nil + } + return p.Metadata +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetName() string { + if p == nil || p.Name == nil { + return "" + } + return *p.Name +} + +// GetPackageHTMLURL returns the PackageHTMLURL field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetPackageHTMLURL() string { + if p == nil || p.PackageHTMLURL == nil { + return "" + } + return *p.PackageHTMLURL +} + // GetPrerelease returns the Prerelease field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetPrerelease() bool { if p == nil || p.Prerelease == nil { @@ -9356,6 +9772,14 @@ func (p *PackageVersion) GetUpdatedAt() Timestamp { return *p.UpdatedAt } +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetURL() string { + if p == nil || p.URL == nil { + return "" + } + return *p.URL +} + // GetVersion returns the Version field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetVersion() string { if p == nil || p.Version == nil { @@ -10476,6 +10900,22 @@ func (p *Protection) GetRestrictions() *BranchRestrictions { return p.Restrictions } +// GetAuthorizedActorNames returns the AuthorizedActorNames field. +func (p *ProtectionChanges) GetAuthorizedActorNames() *AuthorizedActorNames { + if p == nil { + return nil + } + return p.AuthorizedActorNames +} + +// GetAuthorizedActorsOnly returns the AuthorizedActorsOnly field. +func (p *ProtectionChanges) GetAuthorizedActorsOnly() *AuthorizedActorsOnly { + if p == nil { + return nil + } + return p.AuthorizedActorsOnly +} + // GetAllowDeletions returns the AllowDeletions field if it's non-nil, zero value otherwise. func (p *ProtectionRequest) GetAllowDeletions() bool { if p == nil || p.AllowDeletions == nil { @@ -11940,6 +12380,14 @@ func (p *PushEvent) GetInstallation() *Installation { return p.Installation } +// GetOrganization returns the Organization field. +func (p *PushEvent) GetOrganization() *Organization { + if p == nil { + return nil + } + return p.Organization +} + // GetPusher returns the Pusher field. func (p *PushEvent) GetPusher() *User { if p == nil { @@ -13252,6 +13700,14 @@ func (r *Repository) GetReleasesURL() string { return *r.ReleasesURL } +// GetSecurityAndAnalysis returns the SecurityAndAnalysis field. +func (r *Repository) GetSecurityAndAnalysis() *SecurityAndAnalysis { + if r == nil { + return nil + } + return r.SecurityAndAnalysis +} + // GetSize returns the Size field if it's non-nil, zero value otherwise. func (r *Repository) GetSize() int { if r == nil || r.Size == nil { @@ -13412,6 +13868,22 @@ func (r *Repository) GetWatchersCount() int { return *r.WatchersCount } +// GetAdvancedSecurityCommitters returns the AdvancedSecurityCommitters field if it's non-nil, zero value otherwise. +func (r *RepositoryActiveCommitters) GetAdvancedSecurityCommitters() int { + if r == nil || r.AdvancedSecurityCommitters == nil { + return 0 + } + return *r.AdvancedSecurityCommitters +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (r *RepositoryActiveCommitters) GetName() string { + if r == nil || r.Name == nil { + return "" + } + return *r.Name +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (r *RepositoryComment) GetBody() string { if r == nil || r.Body == nil { @@ -14052,6 +14524,14 @@ func (r *RepositoryRelease) GetDraft() bool { return *r.Draft } +// GetGenerateReleaseNotes returns the GenerateReleaseNotes field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetGenerateReleaseNotes() bool { + if r == nil || r.GenerateReleaseNotes == nil { + return false + } + return *r.GenerateReleaseNotes +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (r *RepositoryRelease) GetHTMLURL() string { if r == nil || r.HTMLURL == nil { @@ -14292,6 +14772,14 @@ func (r *RepositoryVulnerabilityAlertEvent) GetAlert() *RepositoryVulnerabilityA return r.Alert } +// GetInstallation returns the Installation field. +func (r *RepositoryVulnerabilityAlertEvent) GetInstallation() *Installation { + if r == nil { + return nil + } + return r.Installation +} + // GetRepository returns the Repository field. func (r *RepositoryVulnerabilityAlertEvent) GetRepository() *Repository { if r == nil { @@ -14692,6 +15180,70 @@ func (r *RunnerLabels) GetType() string { return *r.Type } +// GetCheckoutURI returns the CheckoutURI field if it's non-nil, zero value otherwise. +func (s *SarifAnalysis) GetCheckoutURI() string { + if s == nil || s.CheckoutURI == nil { + return "" + } + return *s.CheckoutURI +} + +// GetCommitSHA returns the CommitSHA field if it's non-nil, zero value otherwise. +func (s *SarifAnalysis) GetCommitSHA() string { + if s == nil || s.CommitSHA == nil { + return "" + } + return *s.CommitSHA +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (s *SarifAnalysis) GetRef() string { + if s == nil || s.Ref == nil { + return "" + } + return *s.Ref +} + +// GetSarif returns the Sarif field if it's non-nil, zero value otherwise. +func (s *SarifAnalysis) GetSarif() string { + if s == nil || s.Sarif == nil { + return "" + } + return *s.Sarif +} + +// GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise. +func (s *SarifAnalysis) GetStartedAt() Timestamp { + if s == nil || s.StartedAt == nil { + return Timestamp{} + } + return *s.StartedAt +} + +// GetToolName returns the ToolName field if it's non-nil, zero value otherwise. +func (s *SarifAnalysis) GetToolName() string { + if s == nil || s.ToolName == nil { + return "" + } + return *s.ToolName +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (s *SarifID) GetID() string { + if s == nil || s.ID == nil { + return "" + } + return *s.ID +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (s *SarifID) GetURL() string { + if s == nil || s.URL == nil { + return "" + } + return *s.URL +} + // GetActive returns the Active field if it's non-nil, zero value otherwise. func (s *SCIMUserAttributes) GetActive() bool { if s == nil || s.Active == nil { @@ -14740,6 +15292,30 @@ func (s *SCIMUserName) GetFormatted() string { return *s.Formatted } +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (s *SecretScanning) GetStatus() string { + if s == nil || s.Status == nil { + return "" + } + return *s.Status +} + +// GetAdvancedSecurity returns the AdvancedSecurity field. +func (s *SecurityAndAnalysis) GetAdvancedSecurity() *AdvancedSecurity { + if s == nil { + return nil + } + return s.AdvancedSecurity +} + +// GetSecretScanning returns the SecretScanning field. +func (s *SecurityAndAnalysis) GetSecretScanning() *SecretScanning { + if s == nil { + return nil + } + return s.SecretScanning +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (s *SelectedReposList) GetTotalCount() int { if s == nil || s.TotalCount == nil { @@ -14908,6 +15484,14 @@ func (s *StarEvent) GetAction() string { return *s.Action } +// GetInstallation returns the Installation field. +func (s *StarEvent) GetInstallation() *Installation { + if s == nil { + return nil + } + return s.Installation +} + // GetOrg returns the Org field. func (s *StarEvent) GetOrg() *Organization { if s == nil { @@ -15884,6 +16468,30 @@ func (t *Timeline) GetAssignee() *User { return t.Assignee } +// GetAssigner returns the Assigner field. +func (t *Timeline) GetAssigner() *User { + if t == nil { + return nil + } + return t.Assigner +} + +// GetAuthor returns the Author field. +func (t *Timeline) GetAuthor() *CommitAuthor { + if t == nil { + return nil + } + return t.Author +} + +// GetBody returns the Body field if it's non-nil, zero value otherwise. +func (t *Timeline) GetBody() string { + if t == nil || t.Body == nil { + return "" + } + return *t.Body +} + // GetCommitID returns the CommitID field if it's non-nil, zero value otherwise. func (t *Timeline) GetCommitID() string { if t == nil || t.CommitID == nil { @@ -15892,6 +16500,14 @@ func (t *Timeline) GetCommitID() string { return *t.CommitID } +// GetCommitter returns the Committer field. +func (t *Timeline) GetCommitter() *CommitAuthor { + if t == nil { + return nil + } + return t.Committer +} + // GetCommitURL returns the CommitURL field if it's non-nil, zero value otherwise. func (t *Timeline) GetCommitURL() string { if t == nil || t.CommitURL == nil { @@ -15932,6 +16548,14 @@ func (t *Timeline) GetLabel() *Label { return t.Label } +// GetMessage returns the Message field if it's non-nil, zero value otherwise. +func (t *Timeline) GetMessage() string { + if t == nil || t.Message == nil { + return "" + } + return *t.Message +} + // GetMilestone returns the Milestone field. func (t *Timeline) GetMilestone() *Milestone { if t == nil { @@ -15956,6 +16580,30 @@ func (t *Timeline) GetRename() *Rename { return t.Rename } +// GetRequester returns the Requester field. +func (t *Timeline) GetRequester() *User { + if t == nil { + return nil + } + return t.Requester +} + +// GetReviewer returns the Reviewer field. +func (t *Timeline) GetReviewer() *User { + if t == nil { + return nil + } + return t.Reviewer +} + +// GetSHA returns the SHA field if it's non-nil, zero value otherwise. +func (t *Timeline) GetSHA() string { + if t == nil || t.SHA == nil { + return "" + } + return *t.SHA +} + // GetSource returns the Source field. func (t *Timeline) GetSource() *Source { if t == nil { @@ -15972,6 +16620,14 @@ func (t *Timeline) GetState() string { return *t.State } +// GetSubmittedAt returns the SubmittedAt field if it's non-nil, zero value otherwise. +func (t *Timeline) GetSubmittedAt() time.Time { + if t == nil || t.SubmittedAt == nil { + return time.Time{} + } + return *t.SubmittedAt +} + // GetURL returns the URL field if it's non-nil, zero value otherwise. func (t *Timeline) GetURL() string { if t == nil || t.URL == nil { @@ -15980,6 +16636,14 @@ func (t *Timeline) GetURL() string { return *t.URL } +// GetUser returns the User field. +func (t *Timeline) GetUser() *User { + if t == nil { + return nil + } + return t.User +} + // GetGUID returns the GUID field if it's non-nil, zero value otherwise. func (t *Tool) GetGUID() string { if t == nil || t.GUID == nil { @@ -16852,6 +17516,14 @@ func (u *UserEvent) GetEnterprise() *Enterprise { return u.Enterprise } +// GetInstallation returns the Installation field. +func (u *UserEvent) GetInstallation() *Installation { + if u == nil { + return nil + } + return u.Installation +} + // GetSender returns the Sender field. func (u *UserEvent) GetSender() *User { if u == nil { @@ -17468,6 +18140,14 @@ func (w *WorkflowBill) GetTotalMS() int64 { return *w.TotalMS } +// GetInstallation returns the Installation field. +func (w *WorkflowDispatchEvent) GetInstallation() *Installation { + if w == nil { + return nil + } + return w.Installation +} + // GetOrg returns the Org field. func (w *WorkflowDispatchEvent) GetOrg() *Organization { if w == nil { @@ -17604,6 +18284,38 @@ func (w *WorkflowJob) GetRunID() int64 { return *w.RunID } +// GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetRunnerGroupID() int64 { + if w == nil || w.RunnerGroupID == nil { + return 0 + } + return *w.RunnerGroupID +} + +// GetRunnerGroupName returns the RunnerGroupName field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetRunnerGroupName() string { + if w == nil || w.RunnerGroupName == nil { + return "" + } + return *w.RunnerGroupName +} + +// GetRunnerID returns the RunnerID field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetRunnerID() int64 { + if w == nil || w.RunnerID == nil { + return 0 + } + return *w.RunnerID +} + +// GetRunnerName returns the RunnerName field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetRunnerName() string { + if w == nil || w.RunnerName == nil { + return "" + } + return *w.RunnerName +} + // GetRunURL returns the RunURL field if it's non-nil, zero value otherwise. func (w *WorkflowJob) GetRunURL() string { if w == nil || w.RunURL == nil { @@ -17644,6 +18356,14 @@ func (w *WorkflowJobEvent) GetAction() string { return *w.Action } +// GetInstallation returns the Installation field. +func (w *WorkflowJobEvent) GetInstallation() *Installation { + if w == nil { + return nil + } + return w.Installation +} + // GetOrg returns the Org field. func (w *WorkflowJobEvent) GetOrg() *Organization { if w == nil { @@ -17692,6 +18412,22 @@ func (w *WorkflowRun) GetCancelURL() string { return *w.CancelURL } +// GetCheckSuiteID returns the CheckSuiteID field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetCheckSuiteID() int64 { + if w == nil || w.CheckSuiteID == nil { + return 0 + } + return *w.CheckSuiteID +} + +// GetCheckSuiteNodeID returns the CheckSuiteNodeID field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetCheckSuiteNodeID() string { + if w == nil || w.CheckSuiteNodeID == nil { + return "" + } + return *w.CheckSuiteNodeID +} + // GetCheckSuiteURL returns the CheckSuiteURL field if it's non-nil, zero value otherwise. func (w *WorkflowRun) GetCheckSuiteURL() string { if w == nil || w.CheckSuiteURL == nil { @@ -17916,6 +18652,14 @@ func (w *WorkflowRunEvent) GetAction() string { return *w.Action } +// GetInstallation returns the Installation field. +func (w *WorkflowRunEvent) GetInstallation() *Installation { + if w == nil { + return nil + } + return w.Installation +} + // GetOrg returns the Org field. func (w *WorkflowRunEvent) GetOrg() *Organization { if w == nil { @@ -17956,6 +18700,22 @@ func (w *WorkflowRunEvent) GetWorkflowRun() *WorkflowRun { return w.WorkflowRun } +// GetDurationMS returns the DurationMS field if it's non-nil, zero value otherwise. +func (w *WorkflowRunJobRun) GetDurationMS() int64 { + if w == nil || w.DurationMS == nil { + return 0 + } + return *w.DurationMS +} + +// GetJobID returns the JobID field if it's non-nil, zero value otherwise. +func (w *WorkflowRunJobRun) GetJobID() int { + if w == nil || w.JobID == nil { + return 0 + } + return *w.JobID +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (w *WorkflowRuns) GetTotalCount() int { if w == nil || w.TotalCount == nil { diff --git a/vendor/github.com/google/go-github/v39/github/github.go b/vendor/github.com/google/go-github/v41/github/github.go similarity index 96% rename from vendor/github.com/google/go-github/v39/github/github.go rename to vendor/github.com/google/go-github/v41/github/github.go index a2727ccf4f..a7afd83436 100644 --- a/vendor/github.com/google/go-github/v39/github/github.go +++ b/vendor/github.com/google/go-github/v41/github/github.go @@ -48,6 +48,21 @@ const ( mediaTypeIssueImportAPI = "application/vnd.github.golden-comet-preview+json" // Media Type values to access preview APIs + // These media types will be added to the API request as headers + // and used to enable particular features on GitHub API that are still in preview. + // After some time, specific media types will be promoted (to a "stable" state). + // From then on, the preview headers are not required anymore to activate the additional + // feature on GitHub.com's API. However, this API header might still be needed for users + // to run a GitHub Enterprise Server on-premise. + // It's not uncommon for GitHub Enterprise Server customers to run older versions which + // would probably rely on the preview headers for some time. + // While the header promotion is going out for GitHub.com, it may be some time before it + // even arrives in GitHub Enterprise Server. + // We keep those preview headers around to avoid breaking older GitHub Enterprise Server + // versions. Additionally, non-functional (preview) headers don't create any side effects + // on GitHub Cloud version. + // + // See https://github.com/google/go-github/pull/2125 for full context. // https://developer.github.com/changes/2014-12-09-new-attributes-for-stars-api/ mediaTypeStarringPreview = "application/vnd.github.v3.star+json" @@ -462,6 +477,10 @@ type Response struct { // Set ListCursorOptions.Cursor to this value when calling the endpoint again. Cursor string + // For APIs that support before/after pagination, such as OrganizationsService.AuditLog. + Before string + After string + // Explicitly specify the Rate type so Rate's String() receiver doesn't // propagate to Response. Rate Rate @@ -517,18 +536,28 @@ func (r *Response) populatePageValues() { } page := q.Get("page") - if page == "" { + since := q.Get("since") + before := q.Get("before") + after := q.Get("after") + + if page == "" && before == "" && after == "" && since == "" { continue } + if since != "" { + page = since + } + for _, segment := range segments[1:] { switch strings.TrimSpace(segment) { case `rel="next"`: if r.NextPage, err = strconv.Atoi(page); err != nil { r.NextPageToken = page } + r.After = after case `rel="prev"`: r.PrevPage, _ = strconv.Atoi(page) + r.Before = before case `rel="first"`: r.FirstPage, _ = strconv.Atoi(page) case `rel="last"`: @@ -708,10 +737,10 @@ func (c *Client) checkRateLimitBeforeDo(req *http.Request, rateLimitCategory rat return nil } -// compareHttpResponse returns whether two http.Response objects are equal or not. +// compareHTTPResponse returns whether two http.Response objects are equal or not. // Currently, only StatusCode is checked. This function is used when implementing the // Is(error) bool interface for the custom error types in this package. -func compareHttpResponse(r1, r2 *http.Response) bool { +func compareHTTPResponse(r1, r2 *http.Response) bool { if r1 == nil && r2 == nil { return true } @@ -761,7 +790,7 @@ func (r *ErrorResponse) Is(target error) bool { } if r.Message != v.Message || (r.DocumentationURL != v.DocumentationURL) || - !compareHttpResponse(r.Response, v.Response) { + !compareHTTPResponse(r.Response, v.Response) { return false } @@ -827,7 +856,7 @@ func (r *RateLimitError) Is(target error) bool { return r.Rate == v.Rate && r.Message == v.Message && - compareHttpResponse(r.Response, v.Response) + compareHTTPResponse(r.Response, v.Response) } // AcceptedError occurs when GitHub returns 202 Accepted response with an @@ -881,7 +910,7 @@ func (r *AbuseRateLimitError) Is(target error) bool { return r.Message == v.Message && r.RetryAfter == v.RetryAfter && - compareHttpResponse(r.Response, v.Response) + compareHTTPResponse(r.Response, v.Response) } // sanitizeURL redacts the client_secret parameter from the URL which may be diff --git a/vendor/github.com/google/go-github/v39/github/gitignore.go b/vendor/github.com/google/go-github/v41/github/gitignore.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/gitignore.go rename to vendor/github.com/google/go-github/v41/github/gitignore.go diff --git a/vendor/github.com/google/go-github/v39/github/interactions.go b/vendor/github.com/google/go-github/v41/github/interactions.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/interactions.go rename to vendor/github.com/google/go-github/v41/github/interactions.go diff --git a/vendor/github.com/google/go-github/v39/github/interactions_orgs.go b/vendor/github.com/google/go-github/v41/github/interactions_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/interactions_orgs.go rename to vendor/github.com/google/go-github/v41/github/interactions_orgs.go diff --git a/vendor/github.com/google/go-github/v39/github/interactions_repos.go b/vendor/github.com/google/go-github/v41/github/interactions_repos.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/interactions_repos.go rename to vendor/github.com/google/go-github/v41/github/interactions_repos.go diff --git a/vendor/github.com/google/go-github/v39/github/issue_import.go b/vendor/github.com/google/go-github/v41/github/issue_import.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/issue_import.go rename to vendor/github.com/google/go-github/v41/github/issue_import.go diff --git a/vendor/github.com/google/go-github/v39/github/issues.go b/vendor/github.com/google/go-github/v41/github/issues.go similarity index 94% rename from vendor/github.com/google/go-github/v39/github/issues.go rename to vendor/github.com/google/go-github/v41/github/issues.go index 46aff2954b..f35f2b566a 100644 --- a/vendor/github.com/google/go-github/v39/github/issues.go +++ b/vendor/github.com/google/go-github/v41/github/issues.go @@ -299,6 +299,29 @@ func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, num return i, resp, nil } +// Remove a milestone from an issue. +// +// This is a helper method to explicitly update an issue with a `null` milestone, thereby removing it. +// +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#update-an-issue +func (s *IssuesService) RemoveMilestone(ctx context.Context, owner, repo string, issueNumber int) (*Issue, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v", owner, repo, issueNumber) + req, err := s.client.NewRequest("PATCH", u, &struct { + Milestone *Milestone `json:"milestone"` + }{}) + if err != nil { + return nil, nil, err + } + + i := new(Issue) + resp, err := s.client.Do(ctx, req, i) + if err != nil { + return nil, resp, err + } + + return i, resp, nil +} + // LockIssueOptions specifies the optional parameters to the // IssuesService.Lock method. type LockIssueOptions struct { diff --git a/vendor/github.com/google/go-github/v39/github/issues_assignees.go b/vendor/github.com/google/go-github/v41/github/issues_assignees.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/issues_assignees.go rename to vendor/github.com/google/go-github/v41/github/issues_assignees.go diff --git a/vendor/github.com/google/go-github/v39/github/issues_comments.go b/vendor/github.com/google/go-github/v41/github/issues_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/issues_comments.go rename to vendor/github.com/google/go-github/v41/github/issues_comments.go diff --git a/vendor/github.com/google/go-github/v39/github/issues_events.go b/vendor/github.com/google/go-github/v41/github/issues_events.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/issues_events.go rename to vendor/github.com/google/go-github/v41/github/issues_events.go diff --git a/vendor/github.com/google/go-github/v39/github/issues_labels.go b/vendor/github.com/google/go-github/v41/github/issues_labels.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/issues_labels.go rename to vendor/github.com/google/go-github/v41/github/issues_labels.go diff --git a/vendor/github.com/google/go-github/v39/github/issues_milestones.go b/vendor/github.com/google/go-github/v41/github/issues_milestones.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/issues_milestones.go rename to vendor/github.com/google/go-github/v41/github/issues_milestones.go diff --git a/vendor/github.com/google/go-github/v39/github/issues_timeline.go b/vendor/github.com/google/go-github/v41/github/issues_timeline.go similarity index 85% rename from vendor/github.com/google/go-github/v39/github/issues_timeline.go rename to vendor/github.com/google/go-github/v41/github/issues_timeline.go index 1fd13b128c..845e3f767c 100644 --- a/vendor/github.com/google/go-github/v39/github/issues_timeline.go +++ b/vendor/github.com/google/go-github/v41/github/issues_timeline.go @@ -15,7 +15,7 @@ import ( // Timeline represents an event that occurred around an Issue or Pull Request. // // It is similar to an IssueEvent but may contain more information. -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/timeline/ +// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/events/issue-event-types type Timeline struct { ID *int64 `json:"id,omitempty"` URL *string `json:"url,omitempty"` @@ -24,6 +24,18 @@ type Timeline struct { // The User object that generated the event. Actor *User `json:"actor,omitempty"` + // The person who commented on the issue. + User *User `json:"user,omitempty"` + + // The person who authored the commit. + Author *CommitAuthor `json:"author,omitempty"` + // The person who committed the commit on behalf of the author. + Committer *CommitAuthor `json:"committer,omitempty"` + // The SHA of the commit in the pull request. + SHA *string `json:"sha,omitempty"` + // The commit message. + Message *string `json:"message,omitempty"` + // Event identifies the actual type of Event that occurred. Possible values // are: // @@ -111,6 +123,8 @@ type Timeline struct { // The User object which was assigned to (or unassigned from) this Issue or // Pull Request. Only provided for 'assigned' and 'unassigned' events. Assignee *User `json:"assignee,omitempty"` + Assigner *User `json:"assigner,omitempty"` + // The Milestone object including a 'title' attribute. // Only provided for 'milestoned' and 'demilestoned' events. Milestone *Milestone `json:"milestone,omitempty"` @@ -125,6 +139,15 @@ type Timeline struct { // 'changes_requested' or 'approved'. // Only provided for 'reviewed' events. State *string `json:"state,omitempty"` + + // The person requested to review the pull request. + Reviewer *User `json:"requested_reviewer,omitempty"` + // The person who requested a review. + Requester *User `json:"review_requester,omitempty"` + + // The review summary text. + Body *string `json:"body,omitempty"` + SubmittedAt *time.Time `json:"submitted_at,omitempty"` } // Source represents a reference's source. diff --git a/vendor/github.com/google/go-github/v39/github/licenses.go b/vendor/github.com/google/go-github/v41/github/licenses.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/licenses.go rename to vendor/github.com/google/go-github/v41/github/licenses.go diff --git a/vendor/github.com/google/go-github/v39/github/messages.go b/vendor/github.com/google/go-github/v41/github/messages.go similarity index 98% rename from vendor/github.com/google/go-github/v39/github/messages.go rename to vendor/github.com/google/go-github/v41/github/messages.go index e46435c9a0..4a03890c7b 100644 --- a/vendor/github.com/google/go-github/v39/github/messages.go +++ b/vendor/github.com/google/go-github/v41/github/messages.go @@ -45,6 +45,7 @@ const ( var ( // eventTypeMapping maps webhooks types to their corresponding go-github struct types. eventTypeMapping = map[string]string{ + "branch_protection_rule": "BranchProtectionRuleEvent", "check_run": "CheckRunEvent", "check_suite": "CheckSuiteEvent", "commit_comment": "CommitCommentEvent", @@ -191,7 +192,7 @@ func ValidatePayloadFromBody(contentType string, readable io.Reader, signature s payload = []byte(form.Get(payloadFormParam)) default: - return nil, fmt.Errorf("Webhook request has unsupported Content-Type %q", contentType) + return nil, fmt.Errorf("webhook request has unsupported Content-Type %q", contentType) } // Only validate the signature if a secret token exists. This is intended for diff --git a/vendor/github.com/google/go-github/v39/github/migrations.go b/vendor/github.com/google/go-github/v41/github/migrations.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/migrations.go rename to vendor/github.com/google/go-github/v41/github/migrations.go diff --git a/vendor/github.com/google/go-github/v39/github/migrations_source_import.go b/vendor/github.com/google/go-github/v41/github/migrations_source_import.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v41/github/migrations_source_import.go diff --git a/vendor/github.com/google/go-github/v39/github/migrations_user.go b/vendor/github.com/google/go-github/v41/github/migrations_user.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/migrations_user.go rename to vendor/github.com/google/go-github/v41/github/migrations_user.go diff --git a/vendor/github.com/google/go-github/v39/github/misc.go b/vendor/github.com/google/go-github/v41/github/misc.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/misc.go rename to vendor/github.com/google/go-github/v41/github/misc.go diff --git a/vendor/github.com/google/go-github/v39/github/orgs.go b/vendor/github.com/google/go-github/v41/github/orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/orgs.go rename to vendor/github.com/google/go-github/v41/github/orgs.go diff --git a/vendor/github.com/google/go-github/v39/github/orgs_actions_allowed.go b/vendor/github.com/google/go-github/v41/github/orgs_actions_allowed.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/orgs_actions_allowed.go rename to vendor/github.com/google/go-github/v41/github/orgs_actions_allowed.go diff --git a/vendor/github.com/google/go-github/v39/github/orgs_actions_permissions.go b/vendor/github.com/google/go-github/v41/github/orgs_actions_permissions.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/orgs_actions_permissions.go rename to vendor/github.com/google/go-github/v41/github/orgs_actions_permissions.go diff --git a/vendor/github.com/google/go-github/v39/github/orgs_audit_log.go b/vendor/github.com/google/go-github/v41/github/orgs_audit_log.go similarity index 90% rename from vendor/github.com/google/go-github/v39/github/orgs_audit_log.go rename to vendor/github.com/google/go-github/v41/github/orgs_audit_log.go index 81f0edac9b..ade57f5411 100644 --- a/vendor/github.com/google/go-github/v39/github/orgs_audit_log.go +++ b/vendor/github.com/google/go-github/v41/github/orgs_audit_log.go @@ -12,9 +12,9 @@ import ( // GetAuditLogOptions sets up optional parameters to query audit-log endpoint. type GetAuditLogOptions struct { - Phrase *string `json:"phrase,omitempty"` // A search phrase. (Optional.) - Include *string `json:"include,omitempty"` // Event type includes. Can be one of "web", "git", "all". Default: "web". (Optional.) - Order *string `json:"order,omitempty"` // The order of audit log events. Can be one of "asc" or "desc". Default: "desc". (Optional.) + Phrase *string `url:"phrase,omitempty"` // A search phrase. (Optional.) + Include *string `url:"include,omitempty"` // Event type includes. Can be one of "web", "git", "all". Default: "web". (Optional.) + Order *string `url:"order,omitempty"` // The order of audit log events. Can be one of "asc" or "desc". Default: "desc". (Optional.) ListCursorOptions } @@ -24,6 +24,9 @@ type HookConfig struct { ContentType *string `json:"content_type,omitempty"` InsecureSSL *string `json:"insecure_ssl,omitempty"` URL *string `json:"url,omitempty"` + + // Secret is returned obfuscated by GitHub, but it can be set for outgoing requests. + Secret *string `json:"secret,omitempty"` } // AuditEntry describes the fields that may be represented by various audit-log "action" entries. @@ -67,9 +70,9 @@ type AuditEntry struct { Repo *string `json:"repo,omitempty"` Repository *string `json:"repository,omitempty"` RepositoryPublic *bool `json:"repository_public,omitempty"` - RunnerGroupID *string `json:"runner_group_id,omitempty"` + RunnerGroupID *int64 `json:"runner_group_id,omitempty"` RunnerGroupName *string `json:"runner_group_name,omitempty"` - RunnerID *string `json:"runner_id,omitempty"` + RunnerID *int64 `json:"runner_id,omitempty"` RunnerLabels []string `json:"runner_labels,omitempty"` RunnerName *string `json:"runner_name,omitempty"` SecretsPassed []string `json:"secrets_passed,omitempty"` diff --git a/vendor/github.com/google/go-github/v39/github/orgs_hooks.go b/vendor/github.com/google/go-github/v41/github/orgs_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v41/github/orgs_hooks.go diff --git a/vendor/github.com/google/go-github/v39/github/orgs_hooks_deliveries.go b/vendor/github.com/google/go-github/v41/github/orgs_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/orgs_hooks_deliveries.go rename to vendor/github.com/google/go-github/v41/github/orgs_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v39/github/orgs_members.go b/vendor/github.com/google/go-github/v41/github/orgs_members.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/orgs_members.go rename to vendor/github.com/google/go-github/v41/github/orgs_members.go diff --git a/vendor/github.com/google/go-github/v39/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v41/github/orgs_outside_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v41/github/orgs_outside_collaborators.go diff --git a/vendor/github.com/google/go-github/v41/github/orgs_packages.go b/vendor/github.com/google/go-github/v41/github/orgs_packages.go new file mode 100644 index 0000000000..0c36f21cae --- /dev/null +++ b/vendor/github.com/google/go-github/v41/github/orgs_packages.go @@ -0,0 +1,149 @@ +// Copyright 2021 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// List the packages for an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#list-packages-for-an-organization +func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opts *PackageListOptions) ([]*Package, *Response, error) { + u := fmt.Sprintf("orgs/%v/packages", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var packages []*Package + resp, err := s.client.Do(ctx, req, &packages) + if err != nil { + return nil, resp, err + } + + return packages, resp, nil +} + +// Get a package by name from an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#get-a-package-for-an-organization +func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, packageName string) (*Package, *Response, error) { + u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, packageName) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var pack *Package + resp, err := s.client.Do(ctx, req, &pack) + if err != nil { + return nil, resp, err + } + + return pack, resp, nil +} + +// Delete a package from an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#delete-a-package-for-an-organization +func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) { + u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, packageName) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// Restore a package to an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#restore-a-package-for-an-organization +func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) { + u := fmt.Sprintf("orgs/%v/packages/%v/%v/restore", org, packageType, packageName) + req, err := s.client.NewRequest("POST", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// Get all versions of a package in an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#get-all-package-versions-for-a-package-owned-by-an-organization +func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) { + u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions", org, packageType, packageName) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var versions []*PackageVersion + resp, err := s.client.Do(ctx, req, &versions) + if err != nil { + return nil, resp, err + } + + return versions, resp, nil +} + +// Get a specific version of a package in an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#get-a-package-version-for-an-organization +func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*PackageVersion, *Response, error) { + u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v", org, packageType, packageName, packageVersionID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var version *PackageVersion + resp, err := s.client.Do(ctx, req, &version) + if err != nil { + return nil, resp, err + } + + return version, resp, nil +} + +// Delete a package version from an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#delete-package-version-for-an-organization +func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v", org, packageType, packageName, packageVersionID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// Restore a package version to an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#restore-package-version-for-an-organization +func (s *OrganizationsService) PackageRestoreVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v/restore", org, packageType, packageName, packageVersionID) + req, err := s.client.NewRequest("POST", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v39/github/orgs_projects.go b/vendor/github.com/google/go-github/v41/github/orgs_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/orgs_projects.go rename to vendor/github.com/google/go-github/v41/github/orgs_projects.go diff --git a/vendor/github.com/google/go-github/v39/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v41/github/orgs_users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v41/github/orgs_users_blocking.go diff --git a/vendor/github.com/google/go-github/v39/github/packages.go b/vendor/github.com/google/go-github/v41/github/packages.go similarity index 52% rename from vendor/github.com/google/go-github/v39/github/packages.go rename to vendor/github.com/google/go-github/v41/github/packages.go index 446e4faa23..ef7df07405 100644 --- a/vendor/github.com/google/go-github/v39/github/packages.go +++ b/vendor/github.com/google/go-github/v41/github/packages.go @@ -16,6 +16,10 @@ type Package struct { Owner *User `json:"owner,omitempty"` PackageVersion *PackageVersion `json:"package_version,omitempty"` Registry *PackageRegistry `json:"registry,omitempty"` + URL *string `json:"url,omitempty"` + VersionCount *int64 `json:"version_count,omitempty"` + Visibility *string `json:"visibility,omitempty"` + Repository *Repository `json:"repository,omitempty"` } func (p Package) String() string { @@ -24,24 +28,28 @@ func (p Package) String() string { // PackageVersion represents a GitHub package version. type PackageVersion struct { - ID *int64 `json:"id,omitempty"` - Version *string `json:"version,omitempty"` - Summary *string `json:"summary,omitempty"` - Body *string `json:"body,omitempty"` - BodyHTML *string `json:"body_html,omitempty"` - Release *PackageRelease `json:"release,omitempty"` - Manifest *string `json:"manifest,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - TagName *string `json:"tag_name,omitempty"` - TargetCommitish *string `json:"target_commitish,omitempty"` - TargetOID *string `json:"target_oid,omitempty"` - Draft *bool `json:"draft,omitempty"` - Prerelease *bool `json:"prerelease,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - PackageFiles []*PackageFile `json:"package_files,omitempty"` - Author *User `json:"author,omitempty"` - InstallationCommand *string `json:"installation_command,omitempty"` + ID *int64 `json:"id,omitempty"` + Version *string `json:"version,omitempty"` + Summary *string `json:"summary,omitempty"` + Body *string `json:"body,omitempty"` + BodyHTML *string `json:"body_html,omitempty"` + Release *PackageRelease `json:"release,omitempty"` + Manifest *string `json:"manifest,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + TagName *string `json:"tag_name,omitempty"` + TargetCommitish *string `json:"target_commitish,omitempty"` + TargetOID *string `json:"target_oid,omitempty"` + Draft *bool `json:"draft,omitempty"` + Prerelease *bool `json:"prerelease,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + PackageFiles []*PackageFile `json:"package_files,omitempty"` + Author *User `json:"author,omitempty"` + InstallationCommand *string `json:"installation_command,omitempty"` + Metadata *PackageMetadata `json:"metadata,omitempty"` + PackageHTMLURL *string `json:"package_html_url,omitempty"` + Name *string `json:"name,omitempty"` + URL *string `json:"url,omitempty"` } func (pv PackageVersion) String() string { @@ -99,3 +107,37 @@ type PackageRegistry struct { func (r PackageRegistry) String() string { return Stringify(r) } + +// PackageListOptions represents the optional list options for a package. +type PackageListOptions struct { + // Visibility of packages "public", "internal" or "private". + Visibility *string `url:"visibility,omitempty"` + + // PackageType represents the type of package. + // It can be one of "npm", "maven", "rubygems", "nuget", "docker", or "container". + PackageType *string `url:"package_type,omitempty"` + + // State of package either "active" or "deleted". + State *string `url:"state,omitempty"` + + ListOptions +} + +// PackageMetadata represents metadata from a package. +type PackageMetadata struct { + PackageType *string `json:"package_type,omitempty"` + Container *PackageContainerMetadata `json:"container,omitempty"` +} + +func (r PackageMetadata) String() string { + return Stringify(r) +} + +// PackageContainerMetadata represents container metadata for docker container packages. +type PackageContainerMetadata struct { + Tags []string `json:"tags,omitempty"` +} + +func (r PackageContainerMetadata) String() string { + return Stringify(r) +} diff --git a/vendor/github.com/google/go-github/v39/github/projects.go b/vendor/github.com/google/go-github/v41/github/projects.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/projects.go rename to vendor/github.com/google/go-github/v41/github/projects.go diff --git a/vendor/github.com/google/go-github/v39/github/pulls.go b/vendor/github.com/google/go-github/v41/github/pulls.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/pulls.go rename to vendor/github.com/google/go-github/v41/github/pulls.go diff --git a/vendor/github.com/google/go-github/v39/github/pulls_comments.go b/vendor/github.com/google/go-github/v41/github/pulls_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/pulls_comments.go rename to vendor/github.com/google/go-github/v41/github/pulls_comments.go diff --git a/vendor/github.com/google/go-github/v39/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v41/github/pulls_reviewers.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v41/github/pulls_reviewers.go diff --git a/vendor/github.com/google/go-github/v39/github/pulls_reviews.go b/vendor/github.com/google/go-github/v41/github/pulls_reviews.go similarity index 88% rename from vendor/github.com/google/go-github/v39/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v41/github/pulls_reviews.go index becd2e0072..437b0937be 100644 --- a/vendor/github.com/google/go-github/v39/github/pulls_reviews.go +++ b/vendor/github.com/google/go-github/v41/github/pulls_reviews.go @@ -125,10 +125,6 @@ func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo strin // GetReview fetches the specified pull request review. // -// TODO: Follow up with GitHub support about an issue with this method's -// returned error format and remove this comment once it's fixed. -// Read more about it here - https://github.com/google/go-github/issues/540 -// // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#get-a-review-for-a-pull-request func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d", owner, repo, number, reviewID) @@ -149,10 +145,6 @@ func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, // DeletePendingReview deletes the specified pull request pending review. // -// TODO: Follow up with GitHub support about an issue with this method's -// returned error format and remove this comment once it's fixed. -// Read more about it here - https://github.com/google/go-github/issues/540 -// // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#delete-a-pending-review-for-a-pull-request func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d", owner, repo, number, reviewID) @@ -173,10 +165,6 @@ func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, re // ListReviewComments lists all the comments for the specified review. // -// TODO: Follow up with GitHub support about an issue with this method's -// returned error format and remove this comment once it's fixed. -// Read more about it here - https://github.com/google/go-github/issues/540 -// // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#list-comments-for-a-pull-request-review func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, repo string, number int, reviewID int64, opts *ListOptions) ([]*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/comments", owner, repo, number, reviewID) @@ -201,10 +189,6 @@ func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, rep // CreateReview creates a new review on the specified pull request. // -// TODO: Follow up with GitHub support about an issue with this method's -// returned error format and remove this comment once it's fixed. -// Read more about it here - https://github.com/google/go-github/issues/540 -// // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#create-a-review-for-a-pull-request // // In order to use multi-line comments, you must use the "comfort fade" preview. @@ -289,10 +273,6 @@ func (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo stri // SubmitReview submits a specified review on the specified pull request. // -// TODO: Follow up with GitHub support about an issue with this method's -// returned error format and remove this comment once it's fixed. -// Read more about it here - https://github.com/google/go-github/issues/540 -// // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#submit-a-review-for-a-pull-request func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/events", owner, repo, number, reviewID) @@ -313,10 +293,6 @@ func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo stri // DismissReview dismisses a specified review on the specified pull request. // -// TODO: Follow up with GitHub support about an issue with this method's -// returned error format and remove this comment once it's fixed. -// Read more about it here - https://github.com/google/go-github/issues/540 -// // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/#dismiss-a-review-for-a-pull-request func (s *PullRequestsService) DismissReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewDismissalRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/dismissals", owner, repo, number, reviewID) diff --git a/vendor/github.com/google/go-github/v39/github/reactions.go b/vendor/github.com/google/go-github/v41/github/reactions.go similarity index 95% rename from vendor/github.com/google/go-github/v39/github/reactions.go rename to vendor/github.com/google/go-github/v41/github/reactions.go index 08387cb50f..ecfcf2e945 100644 --- a/vendor/github.com/google/go-github/v39/github/reactions.go +++ b/vendor/github.com/google/go-github/v41/github/reactions.go @@ -492,3 +492,29 @@ func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Res return s.client.Do(ctx, req, nil) } + +// Create a reaction to a release. +// Note that a response with a Status: 200 OK means that you already +// added the reaction type to this release. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". +// +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-a-release +func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, repo string, releaseID int64, content string) (*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions", owner, repo, releaseID) + + body := &Reaction{Content: String(content)} + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeReactionsPreview) + + m := &Reaction{} + resp, err := s.client.Do(ctx, req, m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} diff --git a/vendor/github.com/google/go-github/v39/github/repos.go b/vendor/github.com/google/go-github/v41/github/repos.go similarity index 91% rename from vendor/github.com/google/go-github/v39/github/repos.go rename to vendor/github.com/google/go-github/v41/github/repos.go index aab18d4d45..45c4618094 100644 --- a/vendor/github.com/google/go-github/v39/github/repos.go +++ b/vendor/github.com/google/go-github/v41/github/repos.go @@ -80,6 +80,9 @@ type Repository struct { LicenseTemplate *string `json:"license_template,omitempty"` GitignoreTemplate *string `json:"gitignore_template,omitempty"` + // Options for configuring Advanced Security and Secret Scanning + SecurityAndAnalysis *SecurityAndAnalysis `json:"security_and_analysis,omitempty"` + // Creating an organization repository. Required for non-owners. TeamID *int64 `json:"team_id,omitempty"` @@ -183,6 +186,39 @@ type RepositoryListOptions struct { ListOptions } +// SecurityAndAnalysis specifies the optional advanced security features +// that are enabled on a given repository. +type SecurityAndAnalysis struct { + AdvancedSecurity *AdvancedSecurity `json:"advanced_security,omitempty"` + SecretScanning *SecretScanning `json:"secret_scanning,omitempty"` +} + +func (s SecurityAndAnalysis) String() string { + return Stringify(s) +} + +// AdvancedSecurity specifies the state of advanced security on a repository. +// +// GitHub API docs: https://docs.github.com/en/github/getting-started-with-github/learning-about-github/about-github-advanced-security +type AdvancedSecurity struct { + Status *string `json:"status,omitempty"` +} + +func (a AdvancedSecurity) String() string { + return Stringify(a) +} + +// SecretScanning specifies the state of secret scanning on a repository. +// +// GitHub API docs: https://docs.github.com/en/code-security/secret-security/about-secret-scanning +type SecretScanning struct { + Status *string `json:"status,omitempty"` +} + +func (s SecretScanning) String() string { + return Stringify(s) +} + // List the repositories for a user. Passing the empty string will list // repositories for the authenticated user. // @@ -767,6 +803,50 @@ type Protection struct { RequiredConversationResolution *RequiredConversationResolution `json:"required_conversation_resolution"` } +// BranchProtectionRule represents the rule applied to a repositories branch. +type BranchProtectionRule struct { + ID *int64 `json:"id,omitempty"` + RepositoryID *int64 `json:"repository_id,omitempty"` + Name *string `json:"name,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + PullRequestReviewsEnforcementLevel *string `json:"pull_request_reviews_enforcement_level,omitempty"` + RequiredApprovingReviewCount *int `json:"required_approving_review_count,omitempty"` + DismissStaleReviewsOnPush *bool `json:"dismiss_stale_reviews_on_push,omitempty"` + AuthorizedDismissalActorsOnly *bool `json:"authorized_dismissal_actors_only,omitempty"` + IgnoreApprovalsFromContributors *bool `json:"ignore_approvals_from_contributors,omitempty"` + RequireCodeOwnerReview *bool `json:"require_code_owner_review,omitempty"` + RequiredStatusChecks []string `json:"required_status_checks,omitempty"` + RequiredStatusChecksEnforcementLevel *string `json:"required_status_checks_enforcement_level,omitempty"` + StrictRequiredStatusChecksPolicy *bool `json:"strict_required_status_checks_policy,omitempty"` + SignatureRequirementEnforcementLevel *string `json:"signature_requirement_enforcement_level,omitempty"` + LinearHistoryRequirementEnforcementLevel *string `json:"linear_history_requirement_enforcement_level,omitempty"` + AdminEnforced *bool `json:"admin_enforced,omitempty"` + AllowForcePushesEnforcementLevel *string `json:"allow_force_pushes_enforcement_level,omitempty"` + AllowDeletionsEnforcementLevel *string `json:"allow_deletions_enforcement_level,omitempty"` + MergeQueueEnforcementLevel *string `json:"merge_queue_enforcement_level,omitempty"` + RequiredDeploymentsEnforcementLevel *string `json:"required_deployments_enforcement_level,omitempty"` + RequiredConversationResolutionLevel *string `json:"required_conversation_resolution_level,omitempty"` + AuthorizedActorsOnly *bool `json:"authorized_actors_only,omitempty"` + AuthorizedActorNames []string `json:"authorized_actor_names,omitempty"` +} + +// ProtectionChanges represents the changes to the rule if the BranchProtection was edited. +type ProtectionChanges struct { + AuthorizedActorsOnly *AuthorizedActorsOnly `json:"authorized_actors_only,omitempty"` + AuthorizedActorNames *AuthorizedActorNames `json:"authorized_actor_names,omitempty"` +} + +// AuthorizedActorNames represents who are authorized to edit the branch protection rules. +type AuthorizedActorNames struct { + From []string `json:"from,omitempty"` +} + +// AuthorizedActorsOnly represents if the branche rule can be edited by authorized actors only. +type AuthorizedActorsOnly struct { + From *bool `json:"from,omitempty"` +} + // ProtectionRequest represents a request to create/edit a branch's protection. type ProtectionRequest struct { RequiredStatusChecks *RequiredStatusChecks `json:"required_status_checks"` @@ -993,6 +1073,34 @@ func (s *RepositoriesService) getBranchFromURL(ctx context.Context, u string, fo return resp, err } +// renameBranchRequest represents a request to rename a branch. +type renameBranchRequest struct { + NewName string `json:"new_name"` +} + +// RenameBranch renames a branch in a repository. +// +// To rename a non-default branch: Users must have push access. GitHub Apps must have the `contents:write` repository permission. +// To rename the default branch: Users must have admin or owner permissions. GitHub Apps must have the `administration:write` repository permission. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/repos#rename-a-branch +func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, branch, newName string) (*Branch, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/branches/%v/rename", owner, repo, branch) + r := &renameBranchRequest{NewName: newName} + req, err := s.client.NewRequest("POST", u, r) + if err != nil { + return nil, nil, err + } + + b := new(Branch) + resp, err := s.client.Do(ctx, req, b) + if err != nil { + return nil, resp, err + } + + return b, resp, nil +} + // GetBranchProtection gets the protection of a given branch. // // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-branch-protection diff --git a/vendor/github.com/google/go-github/v39/github/repos_autolinks.go b/vendor/github.com/google/go-github/v41/github/repos_autolinks.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_autolinks.go rename to vendor/github.com/google/go-github/v41/github/repos_autolinks.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_collaborators.go b/vendor/github.com/google/go-github/v41/github/repos_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v41/github/repos_collaborators.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_comments.go b/vendor/github.com/google/go-github/v41/github/repos_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_comments.go rename to vendor/github.com/google/go-github/v41/github/repos_comments.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_commits.go b/vendor/github.com/google/go-github/v41/github/repos_commits.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_commits.go rename to vendor/github.com/google/go-github/v41/github/repos_commits.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_community_health.go b/vendor/github.com/google/go-github/v41/github/repos_community_health.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_community_health.go rename to vendor/github.com/google/go-github/v41/github/repos_community_health.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_contents.go b/vendor/github.com/google/go-github/v41/github/repos_contents.go similarity index 97% rename from vendor/github.com/google/go-github/v39/github/repos_contents.go rename to vendor/github.com/google/go-github/v41/github/repos_contents.go index d88ae74b39..86e11c0a75 100644 --- a/vendor/github.com/google/go-github/v39/github/repos_contents.go +++ b/vendor/github.com/google/go-github/v41/github/repos_contents.go @@ -132,7 +132,7 @@ func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, for _, contents := range dirContents { if *contents.Name == filename { if contents.DownloadURL == nil || *contents.DownloadURL == "" { - return nil, resp, fmt.Errorf("No download link found for %s", filepath) + return nil, resp, fmt.Errorf("no download link found for %s", filepath) } dlResp, err := s.client.client.Get(*contents.DownloadURL) if err != nil { @@ -141,7 +141,7 @@ func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, return dlResp.Body, &Response{Response: dlResp}, nil } } - return nil, resp, fmt.Errorf("No file named %s found in %s", filename, dir) + return nil, resp, fmt.Errorf("no file named %s found in %s", filename, dir) } // DownloadContentsWithMeta is identical to DownloadContents but additionally @@ -162,7 +162,7 @@ func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owne for _, contents := range dirContents { if *contents.Name == filename { if contents.DownloadURL == nil || *contents.DownloadURL == "" { - return nil, contents, resp, fmt.Errorf("No download link found for %s", filepath) + return nil, contents, resp, fmt.Errorf("no download link found for %s", filepath) } dlResp, err := s.client.client.Get(*contents.DownloadURL) if err != nil { @@ -171,7 +171,7 @@ func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owne return dlResp.Body, contents, &Response{Response: dlResp}, nil } } - return nil, nil, resp, fmt.Errorf("No file named %s found in %s", filename, dir) + return nil, nil, resp, fmt.Errorf("no file named %s found in %s", filename, dir) } // GetContents can return either the metadata and content of a single file diff --git a/vendor/github.com/google/go-github/v39/github/repos_deployments.go b/vendor/github.com/google/go-github/v41/github/repos_deployments.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_deployments.go rename to vendor/github.com/google/go-github/v41/github/repos_deployments.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_environments.go b/vendor/github.com/google/go-github/v41/github/repos_environments.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_environments.go rename to vendor/github.com/google/go-github/v41/github/repos_environments.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_forks.go b/vendor/github.com/google/go-github/v41/github/repos_forks.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_forks.go rename to vendor/github.com/google/go-github/v41/github/repos_forks.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_hooks.go b/vendor/github.com/google/go-github/v41/github/repos_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_hooks.go rename to vendor/github.com/google/go-github/v41/github/repos_hooks.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_hooks_deliveries.go b/vendor/github.com/google/go-github/v41/github/repos_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_hooks_deliveries.go rename to vendor/github.com/google/go-github/v41/github/repos_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_invitations.go b/vendor/github.com/google/go-github/v41/github/repos_invitations.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_invitations.go rename to vendor/github.com/google/go-github/v41/github/repos_invitations.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_keys.go b/vendor/github.com/google/go-github/v41/github/repos_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_keys.go rename to vendor/github.com/google/go-github/v41/github/repos_keys.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_merging.go b/vendor/github.com/google/go-github/v41/github/repos_merging.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_merging.go rename to vendor/github.com/google/go-github/v41/github/repos_merging.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_pages.go b/vendor/github.com/google/go-github/v41/github/repos_pages.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_pages.go rename to vendor/github.com/google/go-github/v41/github/repos_pages.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v41/github/repos_prereceive_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v41/github/repos_prereceive_hooks.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_projects.go b/vendor/github.com/google/go-github/v41/github/repos_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_projects.go rename to vendor/github.com/google/go-github/v41/github/repos_projects.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_releases.go b/vendor/github.com/google/go-github/v41/github/repos_releases.go similarity index 91% rename from vendor/github.com/google/go-github/v39/github/repos_releases.go rename to vendor/github.com/google/go-github/v41/github/repos_releases.go index f7b03f2e2a..1cd2fae669 100644 --- a/vendor/github.com/google/go-github/v39/github/repos_releases.go +++ b/vendor/github.com/google/go-github/v41/github/repos_releases.go @@ -26,6 +26,7 @@ type RepositoryRelease struct { Draft *bool `json:"draft,omitempty"` Prerelease *bool `json:"prerelease,omitempty"` DiscussionCategoryName *string `json:"discussion_category_name,omitempty"` + GenerateReleaseNotes *bool `json:"generate_release_notes,omitempty"` // The following fields are not used in CreateRelease or EditRelease: ID *int64 `json:"id,omitempty"` @@ -46,6 +47,19 @@ func (r RepositoryRelease) String() string { return Stringify(r) } +// RepositoryReleaseNotes represents a GitHub-generated release notes. +type RepositoryReleaseNotes struct { + Name string `json:"name"` + Body string `json:"body"` +} + +// GenerateNotesOptions represents the options to generate release notes. +type GenerateNotesOptions struct { + TagName string `json:"tag_name"` + PreviousTagName *string `json:"previous_tag_name,omitempty"` + TargetCommitish *string `json:"target_commitish,omitempty"` +} + // ReleaseAsset represents a GitHub release asset in a repository. type ReleaseAsset struct { ID *int64 `json:"id,omitempty"` @@ -114,6 +128,25 @@ func (s *RepositoriesService) GetReleaseByTag(ctx context.Context, owner, repo, return s.getSingleRelease(ctx, u) } +// GenerateReleaseNotes generates the release notes for the given tag. +// TODO: api docs +// GitHub API docs: +func (s *RepositoriesService) GenerateReleaseNotes(ctx context.Context, owner, repo string, opts *GenerateNotesOptions) (*RepositoryReleaseNotes, *Response, error) { + u := fmt.Sprintf("repos/%s/%s/releases/generate-notes", owner, repo) + req, err := s.client.NewRequest("POST", u, opts) + if err != nil { + return nil, nil, err + } + + r := new(RepositoryReleaseNotes) + resp, err := s.client.Do(ctx, req, r) + if err != nil { + return nil, resp, err + } + + return r, resp, nil +} + func (s *RepositoriesService) getSingleRelease(ctx context.Context, url string) (*RepositoryRelease, *Response, error) { req, err := s.client.NewRequest("GET", url, nil) if err != nil { @@ -141,6 +174,7 @@ type repositoryReleaseRequest struct { Body *string `json:"body,omitempty"` Draft *bool `json:"draft,omitempty"` Prerelease *bool `json:"prerelease,omitempty"` + GenerateReleaseNotes *bool `json:"generate_release_notes,omitempty"` DiscussionCategoryName *string `json:"discussion_category_name,omitempty"` } @@ -161,6 +195,7 @@ func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo str Draft: release.Draft, Prerelease: release.Prerelease, DiscussionCategoryName: release.DiscussionCategoryName, + GenerateReleaseNotes: release.GenerateReleaseNotes, } req, err := s.client.NewRequest("POST", u, releaseReq) @@ -193,6 +228,7 @@ func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo strin Draft: release.Draft, Prerelease: release.Prerelease, DiscussionCategoryName: release.DiscussionCategoryName, + GenerateReleaseNotes: release.GenerateReleaseNotes, } req, err := s.client.NewRequest("PATCH", u, releaseReq) diff --git a/vendor/github.com/google/go-github/v39/github/repos_stats.go b/vendor/github.com/google/go-github/v41/github/repos_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_stats.go rename to vendor/github.com/google/go-github/v41/github/repos_stats.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_statuses.go b/vendor/github.com/google/go-github/v41/github/repos_statuses.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_statuses.go rename to vendor/github.com/google/go-github/v41/github/repos_statuses.go diff --git a/vendor/github.com/google/go-github/v39/github/repos_traffic.go b/vendor/github.com/google/go-github/v41/github/repos_traffic.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/repos_traffic.go rename to vendor/github.com/google/go-github/v41/github/repos_traffic.go diff --git a/vendor/github.com/google/go-github/v39/github/scim.go b/vendor/github.com/google/go-github/v41/github/scim.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/scim.go rename to vendor/github.com/google/go-github/v41/github/scim.go diff --git a/vendor/github.com/google/go-github/v39/github/search.go b/vendor/github.com/google/go-github/v41/github/search.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/search.go rename to vendor/github.com/google/go-github/v41/github/search.go diff --git a/vendor/github.com/google/go-github/v39/github/strings.go b/vendor/github.com/google/go-github/v41/github/strings.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/strings.go rename to vendor/github.com/google/go-github/v41/github/strings.go diff --git a/vendor/github.com/google/go-github/v39/github/teams.go b/vendor/github.com/google/go-github/v41/github/teams.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/teams.go rename to vendor/github.com/google/go-github/v41/github/teams.go diff --git a/vendor/github.com/google/go-github/v39/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v41/github/teams_discussion_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/teams_discussion_comments.go rename to vendor/github.com/google/go-github/v41/github/teams_discussion_comments.go diff --git a/vendor/github.com/google/go-github/v39/github/teams_discussions.go b/vendor/github.com/google/go-github/v41/github/teams_discussions.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/teams_discussions.go rename to vendor/github.com/google/go-github/v41/github/teams_discussions.go diff --git a/vendor/github.com/google/go-github/v39/github/teams_members.go b/vendor/github.com/google/go-github/v41/github/teams_members.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/teams_members.go rename to vendor/github.com/google/go-github/v41/github/teams_members.go diff --git a/vendor/github.com/google/go-github/v39/github/timestamp.go b/vendor/github.com/google/go-github/v41/github/timestamp.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/timestamp.go rename to vendor/github.com/google/go-github/v41/github/timestamp.go diff --git a/vendor/github.com/google/go-github/v39/github/users.go b/vendor/github.com/google/go-github/v41/github/users.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/users.go rename to vendor/github.com/google/go-github/v41/github/users.go diff --git a/vendor/github.com/google/go-github/v39/github/users_administration.go b/vendor/github.com/google/go-github/v41/github/users_administration.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/users_administration.go rename to vendor/github.com/google/go-github/v41/github/users_administration.go diff --git a/vendor/github.com/google/go-github/v39/github/users_blocking.go b/vendor/github.com/google/go-github/v41/github/users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/users_blocking.go rename to vendor/github.com/google/go-github/v41/github/users_blocking.go diff --git a/vendor/github.com/google/go-github/v39/github/users_emails.go b/vendor/github.com/google/go-github/v41/github/users_emails.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/users_emails.go rename to vendor/github.com/google/go-github/v41/github/users_emails.go diff --git a/vendor/github.com/google/go-github/v39/github/users_followers.go b/vendor/github.com/google/go-github/v41/github/users_followers.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/users_followers.go rename to vendor/github.com/google/go-github/v41/github/users_followers.go diff --git a/vendor/github.com/google/go-github/v39/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v41/github/users_gpg_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v41/github/users_gpg_keys.go diff --git a/vendor/github.com/google/go-github/v39/github/users_keys.go b/vendor/github.com/google/go-github/v41/github/users_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/users_keys.go rename to vendor/github.com/google/go-github/v41/github/users_keys.go diff --git a/vendor/github.com/google/go-github/v41/github/users_packages.go b/vendor/github.com/google/go-github/v41/github/users_packages.go new file mode 100644 index 0000000000..4308b16e1b --- /dev/null +++ b/vendor/github.com/google/go-github/v41/github/users_packages.go @@ -0,0 +1,207 @@ +// Copyright 2021 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// List the packages for a user. Passing the empty string for "user" will +// list packages for the authenticated user. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#list-packages-for-the-authenticated-users-namespace +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#list-packages-for-a-user +func (s *UsersService) ListPackages(ctx context.Context, user string, opts *PackageListOptions) ([]*Package, *Response, error) { + var u string + if user != "" { + u = fmt.Sprintf("users/%v/packages", user) + } else { + u = "user/packages" + } + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var packages []*Package + resp, err := s.client.Do(ctx, req, &packages) + if err != nil { + return nil, resp, err + } + + return packages, resp, nil +} + +// Get a package by name for a user. Passing the empty string for "user" will +// get the package for the authenticated user. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#get-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#get-a-package-for-a-user +func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packageName string) (*Package, *Response, error) { + var u string + if user != "" { + u = fmt.Sprintf("users/%v/packages/%v/%v", user, packageType, packageName) + } else { + u = fmt.Sprintf("user/packages/%v/%v", packageType, packageName) + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var pack *Package + resp, err := s.client.Do(ctx, req, &pack) + if err != nil { + return nil, resp, err + } + + return pack, resp, nil +} + +// Delete a package from a user. Passing the empty string for "user" will +// delete the package for the authenticated user. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#delete-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#delete-a-package-for-a-user +func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, packageName string) (*Response, error) { + var u string + if user != "" { + u = fmt.Sprintf("users/%v/packages/%v/%v", user, packageType, packageName) + } else { + u = fmt.Sprintf("user/packages/%v/%v", packageType, packageName) + } + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// Restore a package to a user. Passing the empty string for "user" will +// restore the package for the authenticated user. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#restore-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#restore-a-package-for-a-user +func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, packageName string) (*Response, error) { + var u string + if user != "" { + u = fmt.Sprintf("users/%v/packages/%v/%v/restore", user, packageType, packageName) + } else { + u = fmt.Sprintf("user/packages/%v/%v/restore", packageType, packageName) + } + + req, err := s.client.NewRequest("POST", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// Get all versions of a package for a user. Passing the empty string for "user" will +// get versions for the authenticated user. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#get-all-package-versions-for-a-package-owned-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/reference/users#delete-an-email-address-for-the-authenticated-user +func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageType, packageName string) ([]*PackageVersion, *Response, error) { + var u string + if user != "" { + u = fmt.Sprintf("users/%v/packages/%v/%v/versions", user, packageType, packageName) + } else { + u = fmt.Sprintf("user/packages/%v/%v/versions", packageType, packageName) + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var versions []*PackageVersion + resp, err := s.client.Do(ctx, req, &versions) + if err != nil { + return nil, resp, err + } + + return versions, resp, nil +} + +// Get a specific version of a package for a user. Passing the empty string for "user" will +// get the version for the authenticated user. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#get-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#get-a-package-version-for-a-user +func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*PackageVersion, *Response, error) { + var u string + if user != "" { + u = fmt.Sprintf("users/%v/packages/%v/%v/versions/%v", user, packageType, packageName, packageVersionID) + } else { + u = fmt.Sprintf("user/packages/%v/%v/versions/%v", packageType, packageName, packageVersionID) + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var version *PackageVersion + resp, err := s.client.Do(ctx, req, &version) + if err != nil { + return nil, resp, err + } + + return version, resp, nil +} + +// Delete a package version for a user. Passing the empty string for "user" will +// delete the version for the authenticated user. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#delete-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#delete-package-version-for-a-user +func (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*Response, error) { + var u string + if user != "" { + u = fmt.Sprintf("users/%v/packages/%v/%v/versions/%v", user, packageType, packageName, packageVersionID) + } else { + u = fmt.Sprintf("user/packages/%v/%v/versions/%v", packageType, packageName, packageVersionID) + } + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// Restore a package version to a user. Passing the empty string for "user" will +// restore the version for the authenticated user. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#restore-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/reference/packages#restore-package-version-for-a-user +func (s *UsersService) PackageRestoreVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*Response, error) { + var u string + if user != "" { + u = fmt.Sprintf("users/%v/packages/%v/%v/versions/%v/restore", user, packageType, packageName, packageVersionID) + } else { + u = fmt.Sprintf("user/packages/%v/%v/versions/%v/restore", packageType, packageName, packageVersionID) + } + + req, err := s.client.NewRequest("POST", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v39/github/users_projects.go b/vendor/github.com/google/go-github/v41/github/users_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/users_projects.go rename to vendor/github.com/google/go-github/v41/github/users_projects.go diff --git a/vendor/github.com/google/go-github/v39/github/with_appengine.go b/vendor/github.com/google/go-github/v41/github/with_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/with_appengine.go rename to vendor/github.com/google/go-github/v41/github/with_appengine.go diff --git a/vendor/github.com/google/go-github/v39/github/without_appengine.go b/vendor/github.com/google/go-github/v41/github/without_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v39/github/without_appengine.go rename to vendor/github.com/google/go-github/v41/github/without_appengine.go diff --git a/vendor/modules.txt b/vendor/modules.txt index d808de2003..b9a0b46f81 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -180,9 +180,9 @@ github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value -# github.com/google/go-github/v39 v39.0.0 +# github.com/google/go-github/v41 v41.0.0 ## explicit -github.com/google/go-github/v39/github +github.com/google/go-github/v41/github # github.com/google/go-querystring v1.1.0 github.com/google/go-querystring/query # github.com/google/uuid v1.1.1