You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: "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'.",
65
65
},
66
+
"fork": {
67
+
Type: schema.TypeBool,
68
+
Optional: true,
69
+
ForceNew: true,
70
+
Description: "Set to 'true' to fork an existing repository.",
71
+
},
72
+
"source_owner": {
73
+
Type: schema.TypeString,
74
+
Optional: true,
75
+
ForceNew: true,
76
+
Description: "The owner of the source repository to fork from.",
77
+
},
78
+
"source_repo": {
79
+
Type: schema.TypeString,
80
+
Optional: true,
81
+
ForceNew: true,
82
+
Description: "The name of the source repository to fork from.",
83
+
},
66
84
"security_and_analysis": {
67
85
Type: schema.TypeList,
68
86
Optional: true,
@@ -561,37 +579,90 @@ func resourceGithubRepositoryCreate(d *schema.ResourceData, meta interface{}) er
description = "This is a fork of another repository"
56
+
fork = true
57
+
source_owner = "some-org"
58
+
source_repo = "original-repository"
59
+
}
60
+
```
61
+
50
62
## Argument Reference
51
63
52
64
The following arguments are supported:
@@ -57,6 +69,12 @@ The following arguments are supported:
57
69
58
70
*`homepage_url` - (Optional) URL of a page describing the project.
59
71
72
+
*`fork` - (Optional) Set to `true` to create a fork of an existing repository. When set to `true`, both `source_owner` and `source_repo` must also be specified.
73
+
74
+
*`source_owner` - (Optional) The GitHub username or organization that owns the repository being forked. Required when `fork` is `true`.
75
+
76
+
*`source_repo` - (Optional) The name of the repository to fork. Required when `fork` is `true`.
77
+
60
78
*`private` - (Optional) Set to `true` to create a private repository.
61
79
Repositories are created as public (e.g. open source) by default.
0 commit comments