Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions docs/resources/repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ resource "github_repository_custom_property" "compliance" {
- `license_template` (String) Use the name of the template without the extension. For example, 'mit' or 'mpl-2.0'.
- `merge_commit_message` (String) Can be 'PR_BODY', 'PR_TITLE', or 'BLANK' for a default merge commit message.
- `merge_commit_title` (String) Can be 'PR_TITLE' or 'MERGE_MESSAGE' for a default merge commit title.
- `pages` (Block List, Max: 1) The repository's GitHub Pages configuration (see [below for nested schema](#nestedblock--pages))
- `private` (Boolean, Deprecated)
- `security_and_analysis` (Block List, Max: 1) Security and analysis settings for the repository. To use this parameter you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. (see [below for nested schema](#nestedblock--security_and_analysis))
- `pages` (Block List) The repository's GitHub Pages configuration. Only one block is permitted. (see [below for nested schema](#nestedblock--pages))
- `private` (Boolean, Deprecated) Set to true to create a private repository. Repositories are created as public (e.g. open source) by default.
- `security_and_analysis` (Block List) Security and analysis settings for the repository. To use this parameter you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. Only one block is permitted. (see [below for nested schema](#nestedblock--security_and_analysis))
- `squash_merge_commit_message` (String) Can be 'PR_BODY', 'COMMIT_MESSAGES', or 'BLANK' for a default squash merge commit message.
- `squash_merge_commit_title` (String) Can be 'PR_TITLE' or 'COMMIT_OR_PR_TITLE' for a default squash merge commit title.
- `template` (Block List, Max: 1) Use a template repository to create this resource. (see [below for nested schema](#nestedblock--template))
- `template` (Block List) Use a template repository to create this resource. Only one block is permitted. (see [below for nested schema](#nestedblock--template))
- `topics` (Set of String) The list of topics of the repository.
- `visibility` (String) Can be 'public' or 'private'. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be 'internal'.
- `vulnerability_alerts` (Boolean) Set to 'true' to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default). Note that vulnerability alerts have not been successfully tested on any GitHub Enterprise instance and may be unavailable in those settings.
Expand All @@ -157,7 +157,7 @@ resource "github_repository_custom_property" "compliance" {
- `git_clone_url` (String) URL that can be provided to 'git clone' to clone the repository anonymously via the git protocol.
- `html_url` (String) URL to the repository on the web.
- `http_clone_url` (String) URL that can be provided to 'git clone' to clone the repository via HTTPS.
- `id` (String) The ID of this resource.
- `id` (String) The ID of the repository.
- `node_id` (String) GraphQL global node id for use with v4 API.
- `primary_language` (String)
- `repo_id` (Number) GitHub ID for the repository.
Expand All @@ -180,7 +180,7 @@ Optional:

- `build_type` (String) The type the page should be sourced.
- `cname` (String) The custom domain for the repository. This can only be set after the repository has been created.
- `source` (Block List, Max: 1) The source branch and directory for the rendered Pages site. (see [below for nested schema](#nestedblock--pages--source))
- `source` (Block List) The source branch and directory for the rendered Pages site. Only one block is permitted. (see [below for nested schema](#nestedblock--pages--source))

Read-Only:

Expand All @@ -207,9 +207,9 @@ Optional:

Optional:

- `advanced_security` (Block List, Max: 1) The advanced security configuration for the repository. If a repository's visibility is 'public', advanced security is always enabled and cannot be changed, so this setting cannot be supplied. (see [below for nested schema](#nestedblock--security_and_analysis--advanced_security))
- `secret_scanning` (Block List, Max: 1) The secret scanning configuration for the repository. (see [below for nested schema](#nestedblock--security_and_analysis--secret_scanning))
- `secret_scanning_push_protection` (Block List, Max: 1) The secret scanning push protection configuration for the repository. (see [below for nested schema](#nestedblock--security_and_analysis--secret_scanning_push_protection))
- `advanced_security` (Block List) The advanced security configuration for the repository. If a repository's visibility is 'public', advanced security is always enabled and cannot be changed, so this setting cannot be supplied. Only one block is permitted. (see [below for nested schema](#nestedblock--security_and_analysis--advanced_security))
- `secret_scanning` (Block List) The secret scanning configuration for the repository. Only one block is permitted. (see [below for nested schema](#nestedblock--security_and_analysis--secret_scanning))
- `secret_scanning_push_protection` (Block List) The secret scanning push protection configuration for the repository. Only one block is permitted. (see [below for nested schema](#nestedblock--security_and_analysis--secret_scanning_push_protection))

<a id="nestedblock--security_and_analysis--advanced_security"></a>
### Nested Schema for `security_and_analysis.advanced_security`
Expand Down
40 changes: 0 additions & 40 deletions github/migrate_github_repository.go

This file was deleted.

30 changes: 0 additions & 30 deletions github/migrate_github_repository_test.go

This file was deleted.

1 change: 0 additions & 1 deletion github/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ func Provider() *schema.Provider {
"github_organization_settings": resourceGithubOrganizationSettings(),
"github_organization_webhook": resourceGithubOrganizationWebhook(),
"github_release": resourceGithubRelease(),
"github_repository": resourceGithubRepository(),
"github_repository_autolink_reference": resourceGithubRepositoryAutolinkReference(),
"github_repository_dependabot_security_updates": resourceGithubRepositoryDependabotSecurityUpdates(),
"github_repository_collaborator": resourceGithubRepositoryCollaborator(),
Expand Down
37 changes: 37 additions & 0 deletions github/provider_test.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,54 @@
package github

import (
"context"
"fmt"
"testing"

"github.com/hashicorp/terraform-plugin-framework/providerserver"
"github.com/hashicorp/terraform-plugin-go/tfprotov6"
"github.com/hashicorp/terraform-plugin-mux/tf5to6server"
"github.com/hashicorp/terraform-plugin-mux/tf6muxserver"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"

"github.com/nexthink-oss/terraform-provider-github/v7/internal/provider"
)

var testAccProviders map[string]*schema.Provider
var testAccProviderFactories func(providers *[]*schema.Provider) map[string]func() (*schema.Provider, error)
var testAccProvider *schema.Provider

// testAccProtoV6ProviderFactories provides Protocol 6 provider factories for testing
// with muxing support (Framework + upgraded SDKv2)
var testAccProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){
"github": func() (tfprotov6.ProviderServer, error) {
ctx := context.Background()

// Upgrade SDKv2 provider (Protocol 5) to Protocol 6
upgradedSdkServer, err := tf5to6server.UpgradeServer(
ctx,
Provider().GRPCProvider,
)
if err != nil {
return nil, err
}

// Combine Framework (Protocol 6) and upgraded SDKv2 providers
providers := []func() tfprotov6.ProviderServer{
providerserver.NewProtocol6(provider.NewFrameworkProvider()()),
func() tfprotov6.ProviderServer { return upgradedSdkServer },
}

muxServer, err := tf6muxserver.NewMuxServer(ctx, providers...)
if err != nil {
return nil, err
}

return muxServer.ProviderServer(), nil
},
}

func init() {
testAccProvider = Provider()
testAccProviders = map[string]*schema.Provider{
Expand Down
Loading
Loading