@@ -571,7 +571,7 @@ func TestAccGithubRepository(t *testing.T) {
571571
572572 t .Run ("create_private_with_forking" , func (t * testing.T ) {
573573 randomID := acctest .RandStringFromCharSet (5 , acctest .CharSetAlphaNum )
574- repoName := fmt .Sprintf ("%svisibility- %s" , testResourcePrefix , randomID )
574+ repoName := fmt .Sprintf ("%s %s" , testResourcePrefix , randomID )
575575
576576 config := fmt .Sprintf (`
577577 resource "github_repository" "test" {
@@ -597,6 +597,33 @@ func TestAccGithubRepository(t *testing.T) {
597597 })
598598 })
599599
600+ t .Run ("create_private_with_forking_unset" , func (t * testing.T ) {
601+ randomID := acctest .RandStringFromCharSet (5 , acctest .CharSetAlphaNum )
602+ repoName := fmt .Sprintf ("%s%s" , testResourcePrefix , randomID )
603+
604+ config := fmt .Sprintf (`
605+ resource "github_repository" "test" {
606+ name = "%s"
607+ description = "A private repository with forking disabled"
608+ visibility = "private"
609+ }
610+ ` , repoName )
611+
612+ resource .Test (t , resource.TestCase {
613+ PreCheck : func () { skipUnlessHasOrgs (t ) },
614+ ProviderFactories : providerFactories ,
615+ Steps : []resource.TestStep {
616+ {
617+ Config : config ,
618+ Check : resource .ComposeTestCheckFunc (
619+ resource .TestCheckResourceAttr ("github_repository.test" , "visibility" , "private" ),
620+ resource .TestCheckResourceAttr ("github_repository.test" , "allow_forking" , "false" ),
621+ ),
622+ },
623+ },
624+ })
625+ })
626+
600627 t .Run ("configures vulnerability alerts for a private repository" , func (t * testing.T ) {
601628 randomID := acctest .RandStringFromCharSet (5 , acctest .CharSetAlphaNum )
602629 repoName := fmt .Sprintf ("%sprv-vuln-%s" , testResourcePrefix , randomID )
0 commit comments