@pulumi/github 5.0.0 → 5.2.0-alpha.1673638210

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. package/actionsEnvironmentSecret.d.ts +99 -0
  2. package/actionsEnvironmentSecret.js +68 -24
  3. package/actionsEnvironmentSecret.js.map +1 -1
  4. package/actionsOrganizationPermissions.d.ts +74 -1
  5. package/actionsOrganizationPermissions.js +58 -22
  6. package/actionsOrganizationPermissions.js.map +1 -1
  7. package/actionsOrganizationSecret.d.ts +110 -0
  8. package/actionsOrganizationSecret.js +76 -24
  9. package/actionsOrganizationSecret.js.map +1 -1
  10. package/actionsOrganizationSecretRepositories.d.ts +47 -0
  11. package/actionsOrganizationSecretRepositories.js +51 -22
  12. package/actionsOrganizationSecretRepositories.js.map +1 -1
  13. package/actionsRepositoryPermissions.d.ts +119 -0
  14. package/actionsRepositoryPermissions.js +91 -0
  15. package/actionsRepositoryPermissions.js.map +1 -0
  16. package/actionsRunnerGroup.d.ts +88 -0
  17. package/actionsRunnerGroup.js +47 -22
  18. package/actionsRunnerGroup.js.map +1 -1
  19. package/actionsSecret.d.ts +70 -0
  20. package/actionsSecret.js +48 -24
  21. package/actionsSecret.js.map +1 -1
  22. package/appInstallationRepositories.d.ts +81 -0
  23. package/appInstallationRepositories.js +78 -0
  24. package/appInstallationRepositories.js.map +1 -0
  25. package/appInstallationRepository.d.ts +53 -0
  26. package/appInstallationRepository.js +57 -22
  27. package/appInstallationRepository.js.map +1 -1
  28. package/branch.d.ts +92 -0
  29. package/branch.js +60 -22
  30. package/branch.js.map +1 -1
  31. package/branchDefault.d.ts +53 -0
  32. package/branchDefault.js +57 -22
  33. package/branchDefault.js.map +1 -1
  34. package/branchProtection.d.ts +175 -4
  35. package/branchProtection.js +83 -22
  36. package/branchProtection.js.map +1 -1
  37. package/branchProtectionV3.d.ts +140 -1
  38. package/branchProtectionV3.js +88 -22
  39. package/branchProtectionV3.js.map +1 -1
  40. package/config/vars.d.ts +1 -1
  41. package/config/vars.js.map +1 -1
  42. package/dependabotOrganizationSecret.js +26 -24
  43. package/dependabotOrganizationSecret.js.map +1 -1
  44. package/dependabotOrganizationSecretRepositories.js +22 -22
  45. package/dependabotOrganizationSecretRepositories.js.map +1 -1
  46. package/dependabotSecret.js +26 -24
  47. package/dependabotSecret.js.map +1 -1
  48. package/emuGroupMapping.d.ts +42 -0
  49. package/emuGroupMapping.js +46 -22
  50. package/emuGroupMapping.js.map +1 -1
  51. package/getActionsOrganizationRegistrationToken.d.ts +31 -0
  52. package/getActionsOrganizationRegistrationToken.js +25 -0
  53. package/getActionsOrganizationRegistrationToken.js.map +1 -0
  54. package/getActionsOrganizationSecrets.d.ts +16 -1
  55. package/getActionsOrganizationSecrets.js +13 -4
  56. package/getActionsOrganizationSecrets.js.map +1 -1
  57. package/getActionsPublicKey.d.ts +42 -0
  58. package/getActionsPublicKey.js +32 -5
  59. package/getActionsPublicKey.js.map +1 -1
  60. package/getActionsRegistrationToken.d.ts +67 -0
  61. package/getActionsRegistrationToken.js +47 -0
  62. package/getActionsRegistrationToken.js.map +1 -0
  63. package/getActionsSecrets.d.ts +47 -1
  64. package/getActionsSecrets.js +30 -5
  65. package/getActionsSecrets.js.map +1 -1
  66. package/getBranch.d.ts +51 -0
  67. package/getBranch.js +32 -5
  68. package/getBranch.js.map +1 -1
  69. package/getCollaborators.d.ts +52 -1
  70. package/getCollaborators.js +32 -5
  71. package/getCollaborators.js.map +1 -1
  72. package/getDependabotOrganizationSecrets.d.ts +28 -0
  73. package/getDependabotOrganizationSecrets.js +25 -0
  74. package/getDependabotOrganizationSecrets.js.map +1 -0
  75. package/getDependabotPublicKey.js +2 -5
  76. package/getDependabotPublicKey.js.map +1 -1
  77. package/getDependabotSecrets.d.ts +76 -0
  78. package/getDependabotSecrets.js +49 -0
  79. package/getDependabotSecrets.js.map +1 -0
  80. package/getExternalGroups.d.ts +18 -1
  81. package/getExternalGroups.js +15 -4
  82. package/getExternalGroups.js.map +1 -1
  83. package/getGithubApp.d.ts +71 -0
  84. package/getGithubApp.js +47 -0
  85. package/getGithubApp.js.map +1 -0
  86. package/getIpRanges.d.ts +84 -0
  87. package/getIpRanges.js +13 -4
  88. package/getIpRanges.js.map +1 -1
  89. package/getMembership.d.ts +59 -0
  90. package/getMembership.js +36 -5
  91. package/getMembership.js.map +1 -1
  92. package/getOrganization.d.ts +58 -0
  93. package/getOrganization.js +30 -5
  94. package/getOrganization.js.map +1 -1
  95. package/getOrganizationIpAllowList.d.ts +31 -0
  96. package/getOrganizationIpAllowList.js +27 -0
  97. package/getOrganizationIpAllowList.js.map +1 -0
  98. package/getOrganizationTeamSyncGroups.d.ts +16 -1
  99. package/getOrganizationTeamSyncGroups.js +13 -4
  100. package/getOrganizationTeamSyncGroups.js.map +1 -1
  101. package/getOrganizationTeams.d.ts +87 -1
  102. package/getOrganizationTeams.js +54 -5
  103. package/getOrganizationTeams.js.map +1 -1
  104. package/getOrganizationWebhooks.d.ts +31 -0
  105. package/getOrganizationWebhooks.js +27 -0
  106. package/getOrganizationWebhooks.js.map +1 -0
  107. package/getRef.d.ts +48 -0
  108. package/getRef.js +32 -5
  109. package/getRef.js.map +1 -1
  110. package/getRelease.d.ts +92 -0
  111. package/getRelease.js +8 -5
  112. package/getRelease.js.map +1 -1
  113. package/getRepositories.d.ts +70 -0
  114. package/getRepositories.js +40 -5
  115. package/getRepositories.js.map +1 -1
  116. package/getRepository.d.ts +142 -4
  117. package/getRepository.js +30 -6
  118. package/getRepository.js.map +1 -1
  119. package/getRepositoryBranches.d.ts +82 -0
  120. package/getRepositoryBranches.js +49 -0
  121. package/getRepositoryBranches.js.map +1 -0
  122. package/getRepositoryDeployKeys.d.ts +64 -0
  123. package/getRepositoryDeployKeys.js +47 -0
  124. package/getRepositoryDeployKeys.js.map +1 -0
  125. package/getRepositoryFile.d.ts +72 -0
  126. package/getRepositoryFile.js +36 -5
  127. package/getRepositoryFile.js.map +1 -1
  128. package/getRepositoryMilestone.d.ts +62 -0
  129. package/getRepositoryMilestone.js +34 -5
  130. package/getRepositoryMilestone.js.map +1 -1
  131. package/getRepositoryPullRequest.d.ts +90 -0
  132. package/getRepositoryPullRequest.js +32 -5
  133. package/getRepositoryPullRequest.js.map +1 -1
  134. package/getRepositoryPullRequests.d.ts +91 -1
  135. package/getRepositoryPullRequests.js +38 -5
  136. package/getRepositoryPullRequests.js.map +1 -1
  137. package/getRepositoryTeams.d.ts +47 -1
  138. package/getRepositoryTeams.js +30 -5
  139. package/getRepositoryTeams.js.map +1 -1
  140. package/getRepositoryWebhooks.d.ts +63 -0
  141. package/getRepositoryWebhooks.js +51 -0
  142. package/getRepositoryWebhooks.js.map +1 -0
  143. package/getTeam.d.ts +79 -0
  144. package/getTeam.js +32 -5
  145. package/getTeam.js.map +1 -1
  146. package/getTree.d.ts +70 -1
  147. package/getTree.js +50 -5
  148. package/getTree.js.map +1 -1
  149. package/getUser.d.ts +102 -0
  150. package/getUser.js +38 -5
  151. package/getUser.js.map +1 -1
  152. package/getUsers.d.ts +55 -0
  153. package/getUsers.js +42 -5
  154. package/getUsers.js.map +1 -1
  155. package/index.d.ts +244 -68
  156. package/index.js +259 -171
  157. package/index.js.map +1 -1
  158. package/issue.d.ts +117 -6
  159. package/issue.js +85 -22
  160. package/issue.js.map +1 -1
  161. package/issueLabel.d.ts +64 -0
  162. package/issueLabel.js +44 -22
  163. package/issueLabel.js.map +1 -1
  164. package/membership.d.ts +49 -0
  165. package/membership.js +49 -21
  166. package/membership.js.map +1 -1
  167. package/organizationBlock.d.ts +21 -0
  168. package/organizationBlock.js +31 -19
  169. package/organizationBlock.js.map +1 -1
  170. package/organizationProject.d.ts +36 -0
  171. package/organizationProject.js +32 -20
  172. package/organizationProject.js.map +1 -1
  173. package/organizationSecurityManager.d.ts +67 -0
  174. package/organizationSecurityManager.js +71 -0
  175. package/organizationSecurityManager.js.map +1 -0
  176. package/organizationSettings.d.ts +394 -0
  177. package/organizationSettings.js +148 -0
  178. package/organizationSettings.js.map +1 -0
  179. package/organizationWebhook.d.ts +65 -1
  180. package/organizationWebhook.js +52 -22
  181. package/organizationWebhook.js.map +1 -1
  182. package/package.json +2 -2
  183. package/package.json.dev +2 -2
  184. package/projectCard.d.ts +87 -0
  185. package/projectCard.js +73 -22
  186. package/projectCard.js.map +1 -1
  187. package/projectColumn.d.ts +31 -0
  188. package/projectColumn.js +35 -22
  189. package/projectColumn.js.map +1 -1
  190. package/provider.d.ts +1 -1
  191. package/provider.js +10 -10
  192. package/provider.js.map +1 -1
  193. package/release.d.ts +194 -0
  194. package/release.js +121 -0
  195. package/release.js.map +1 -0
  196. package/repository.d.ts +396 -4
  197. package/repository.js +72 -22
  198. package/repository.js.map +1 -1
  199. package/repositoryAutolinkReference.d.ts +54 -6
  200. package/repositoryAutolinkReference.js +54 -22
  201. package/repositoryAutolinkReference.js.map +1 -1
  202. package/repositoryCollaborator.d.ts +90 -0
  203. package/repositoryCollaborator.js +64 -22
  204. package/repositoryCollaborator.js.map +1 -1
  205. package/repositoryDeployKey.d.ts +71 -0
  206. package/repositoryDeployKey.js +57 -22
  207. package/repositoryDeployKey.js.map +1 -1
  208. package/repositoryEnvironment.d.ts +63 -1
  209. package/repositoryEnvironment.js +56 -22
  210. package/repositoryEnvironment.js.map +1 -1
  211. package/repositoryFile.d.ts +70 -30
  212. package/repositoryFile.js +59 -22
  213. package/repositoryFile.js.map +1 -1
  214. package/repositoryMilestone.d.ts +81 -3
  215. package/repositoryMilestone.js +49 -22
  216. package/repositoryMilestone.js.map +1 -1
  217. package/repositoryProject.d.ts +52 -0
  218. package/repositoryProject.js +41 -22
  219. package/repositoryProject.js.map +1 -1
  220. package/repositoryPullRequest.d.ts +127 -4
  221. package/repositoryPullRequest.js +40 -22
  222. package/repositoryPullRequest.js.map +1 -1
  223. package/repositoryTagProtection.d.ts +41 -0
  224. package/repositoryTagProtection.js +45 -22
  225. package/repositoryTagProtection.js.map +1 -1
  226. package/repositoryWebhook.d.ts +81 -1
  227. package/repositoryWebhook.js +59 -22
  228. package/repositoryWebhook.js.map +1 -1
  229. package/team.d.ts +100 -0
  230. package/team.js +49 -22
  231. package/team.js.map +1 -1
  232. package/teamMembers.d.ts +60 -1
  233. package/teamMembers.js +62 -22
  234. package/teamMembers.js.map +1 -1
  235. package/teamMembership.d.ts +67 -0
  236. package/teamMembership.js +59 -22
  237. package/teamMembership.js.map +1 -1
  238. package/teamRepository.d.ts +59 -3
  239. package/teamRepository.js +57 -22
  240. package/teamRepository.js.map +1 -1
  241. package/teamSettings.d.ts +119 -0
  242. package/teamSettings.js +99 -0
  243. package/teamSettings.js.map +1 -0
  244. package/teamSyncGroupMapping.d.ts +38 -1
  245. package/teamSyncGroupMapping.js +36 -21
  246. package/teamSyncGroupMapping.js.map +1 -1
  247. package/types/index.js.map +1 -1
  248. package/types/input.d.ts +208 -1
  249. package/types/output.d.ts +555 -1
  250. package/userGpgKey.d.ts +39 -0
  251. package/userGpgKey.js +42 -21
  252. package/userGpgKey.js.map +1 -1
  253. package/userInvitationAccepter.d.ts +30 -0
  254. package/userInvitationAccepter.js +38 -17
  255. package/userInvitationAccepter.js.map +1 -1
  256. package/userSshKey.d.ts +50 -0
  257. package/userSshKey.js +48 -22
  258. package/userSshKey.js.map +1 -1
  259. package/utilities.js +13 -1
  260. package/utilities.js.map +1 -1
package/branch.d.ts CHANGED
@@ -1,4 +1,42 @@
1
1
  import * as pulumi from "@pulumi/pulumi";
2
+ /**
3
+ * This resource allows you to create and manage branches within your repository.
4
+ *
5
+ * Additional constraints can be applied to ensure your branch is created from
6
+ * another branch or commit.
7
+ *
8
+ * ## Example Usage
9
+ *
10
+ * ```typescript
11
+ * import * as pulumi from "@pulumi/pulumi";
12
+ * import * as github from "@pulumi/github";
13
+ *
14
+ * const development = new github.Branch("development", {
15
+ * branch: "development",
16
+ * repository: "example",
17
+ * });
18
+ * ```
19
+ *
20
+ * ## Import
21
+ *
22
+ * GitHub Branch can be imported using an ID made up of `repository:branch`, e.g.
23
+ *
24
+ * ```sh
25
+ * $ pulumi import github:index/branch:Branch terraform terraform:main
26
+ * ```
27
+ *
28
+ * Importing github branch into an instance object (when using a for each block to manage multiple branches)
29
+ *
30
+ * ```sh
31
+ * $ pulumi import github:index/branch:Branch terraform["terraform"] terraform:main
32
+ * ```
33
+ *
34
+ * Optionally, a source branch may be specified using an ID of `repository:branch:source_branch`. This is useful for importing branches that do not branch directly off main.
35
+ *
36
+ * ```sh
37
+ * $ pulumi import github:index/branch:Branch terraform terraform:feature-branch:dev
38
+ * ```
39
+ */
2
40
  export declare class Branch extends pulumi.CustomResource {
3
41
  /**
4
42
  * Get an existing Branch resource's state with the given name, ID, and optional extra
@@ -15,12 +53,33 @@ export declare class Branch extends pulumi.CustomResource {
15
53
  * when multiple copies of the Pulumi SDK have been loaded into the same process.
16
54
  */
17
55
  static isInstance(obj: any): obj is Branch;
56
+ /**
57
+ * The repository branch to create.
58
+ */
18
59
  readonly branch: pulumi.Output<string>;
60
+ /**
61
+ * An etag representing the Branch object.
62
+ */
19
63
  readonly etag: pulumi.Output<string>;
64
+ /**
65
+ * A string representing a branch reference, in the form of `refs/heads/<branch>`.
66
+ */
20
67
  readonly ref: pulumi.Output<string>;
68
+ /**
69
+ * The GitHub repository name.
70
+ */
21
71
  readonly repository: pulumi.Output<string>;
72
+ /**
73
+ * A string storing the reference's `HEAD` commit's SHA1.
74
+ */
22
75
  readonly sha: pulumi.Output<string>;
76
+ /**
77
+ * The branch name to start from. Defaults to `main`.
78
+ */
23
79
  readonly sourceBranch: pulumi.Output<string | undefined>;
80
+ /**
81
+ * The commit hash to start from. Defaults to the tip of `sourceBranch`. If provided, `sourceBranch` is ignored.
82
+ */
24
83
  readonly sourceSha: pulumi.Output<string>;
25
84
  /**
26
85
  * Create a Branch resource with the given unique name, arguments, and options.
@@ -35,20 +94,53 @@ export declare class Branch extends pulumi.CustomResource {
35
94
  * Input properties used for looking up and filtering Branch resources.
36
95
  */
37
96
  export interface BranchState {
97
+ /**
98
+ * The repository branch to create.
99
+ */
38
100
  branch?: pulumi.Input<string>;
101
+ /**
102
+ * An etag representing the Branch object.
103
+ */
39
104
  etag?: pulumi.Input<string>;
105
+ /**
106
+ * A string representing a branch reference, in the form of `refs/heads/<branch>`.
107
+ */
40
108
  ref?: pulumi.Input<string>;
109
+ /**
110
+ * The GitHub repository name.
111
+ */
41
112
  repository?: pulumi.Input<string>;
113
+ /**
114
+ * A string storing the reference's `HEAD` commit's SHA1.
115
+ */
42
116
  sha?: pulumi.Input<string>;
117
+ /**
118
+ * The branch name to start from. Defaults to `main`.
119
+ */
43
120
  sourceBranch?: pulumi.Input<string>;
121
+ /**
122
+ * The commit hash to start from. Defaults to the tip of `sourceBranch`. If provided, `sourceBranch` is ignored.
123
+ */
44
124
  sourceSha?: pulumi.Input<string>;
45
125
  }
46
126
  /**
47
127
  * The set of arguments for constructing a Branch resource.
48
128
  */
49
129
  export interface BranchArgs {
130
+ /**
131
+ * The repository branch to create.
132
+ */
50
133
  branch: pulumi.Input<string>;
134
+ /**
135
+ * The GitHub repository name.
136
+ */
51
137
  repository: pulumi.Input<string>;
138
+ /**
139
+ * The branch name to start from. Defaults to `main`.
140
+ */
52
141
  sourceBranch?: pulumi.Input<string>;
142
+ /**
143
+ * The commit hash to start from. Defaults to the tip of `sourceBranch`. If provided, `sourceBranch` is ignored.
144
+ */
53
145
  sourceSha?: pulumi.Input<string>;
54
146
  }
package/branch.js CHANGED
@@ -5,7 +5,67 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.Branch = void 0;
6
6
  const pulumi = require("@pulumi/pulumi");
7
7
  const utilities = require("./utilities");
8
+ /**
9
+ * This resource allows you to create and manage branches within your repository.
10
+ *
11
+ * Additional constraints can be applied to ensure your branch is created from
12
+ * another branch or commit.
13
+ *
14
+ * ## Example Usage
15
+ *
16
+ * ```typescript
17
+ * import * as pulumi from "@pulumi/pulumi";
18
+ * import * as github from "@pulumi/github";
19
+ *
20
+ * const development = new github.Branch("development", {
21
+ * branch: "development",
22
+ * repository: "example",
23
+ * });
24
+ * ```
25
+ *
26
+ * ## Import
27
+ *
28
+ * GitHub Branch can be imported using an ID made up of `repository:branch`, e.g.
29
+ *
30
+ * ```sh
31
+ * $ pulumi import github:index/branch:Branch terraform terraform:main
32
+ * ```
33
+ *
34
+ * Importing github branch into an instance object (when using a for each block to manage multiple branches)
35
+ *
36
+ * ```sh
37
+ * $ pulumi import github:index/branch:Branch terraform["terraform"] terraform:main
38
+ * ```
39
+ *
40
+ * Optionally, a source branch may be specified using an ID of `repository:branch:source_branch`. This is useful for importing branches that do not branch directly off main.
41
+ *
42
+ * ```sh
43
+ * $ pulumi import github:index/branch:Branch terraform terraform:feature-branch:dev
44
+ * ```
45
+ */
8
46
  class Branch extends pulumi.CustomResource {
47
+ /**
48
+ * Get an existing Branch resource's state with the given name, ID, and optional extra
49
+ * properties used to qualify the lookup.
50
+ *
51
+ * @param name The _unique_ name of the resulting resource.
52
+ * @param id The _unique_ provider ID of the resource to lookup.
53
+ * @param state Any extra arguments used during the lookup.
54
+ * @param opts Optional settings to control the behavior of the CustomResource.
55
+ */
56
+ static get(name, id, state, opts) {
57
+ return new Branch(name, state, Object.assign(Object.assign({}, opts), { id: id }));
58
+ }
59
+ /**
60
+ * Returns true if the given object is an instance of Branch. This is designed to work even
61
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
62
+ */
63
+ static isInstance(obj) {
64
+ if (obj === undefined || obj === null) {
65
+ return false;
66
+ }
67
+ return obj['__pulumiType'] === Branch.__pulumiType;
68
+ }
9
69
  constructor(name, argsOrState, opts) {
10
70
  let resourceInputs = {};
11
71
  opts = opts || {};
@@ -38,28 +98,6 @@ class Branch extends pulumi.CustomResource {
38
98
  opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
39
99
  super(Branch.__pulumiType, name, resourceInputs, opts);
40
100
  }
41
- /**
42
- * Get an existing Branch resource's state with the given name, ID, and optional extra
43
- * properties used to qualify the lookup.
44
- *
45
- * @param name The _unique_ name of the resulting resource.
46
- * @param id The _unique_ provider ID of the resource to lookup.
47
- * @param state Any extra arguments used during the lookup.
48
- * @param opts Optional settings to control the behavior of the CustomResource.
49
- */
50
- static get(name, id, state, opts) {
51
- return new Branch(name, state, Object.assign(Object.assign({}, opts), { id: id }));
52
- }
53
- /**
54
- * Returns true if the given object is an instance of Branch. This is designed to work even
55
- * when multiple copies of the Pulumi SDK have been loaded into the same process.
56
- */
57
- static isInstance(obj) {
58
- if (obj === undefined || obj === null) {
59
- return false;
60
- }
61
- return obj['__pulumiType'] === Branch.__pulumiType;
62
- }
63
101
  }
64
102
  exports.Branch = Branch;
65
103
  /** @internal */
package/branch.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"branch.js","sourceRoot":"","sources":["../branch.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC,MAAa,MAAO,SAAQ,MAAM,CAAC,cAAc;IA4C7C,YAAY,IAAY,EAAE,WAAsC,EAAE,IAAmC;QACjG,IAAI,cAAc,GAAkB,EAAE,CAAC;QACvC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAClB,IAAI,IAAI,CAAC,EAAE,EAAE;YACT,MAAM,KAAK,GAAG,WAAsC,CAAC;YACrD,cAAc,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;YAC5D,cAAc,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;YACxD,cAAc,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;YACtD,cAAc,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CA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pulumi from "@pulumi/pulumi";
2
+ /**
3
+ * Provides a GitHub branch default resource.
4
+ *
5
+ * This resource allows you to set the default branch for a given repository.
6
+ *
7
+ * Note that use of this resource is incompatible with the `defaultBranch` option of the `github.Repository` resource. Using both will result in plans always showing a diff.
8
+ *
9
+ * ## Example Usage
10
+ *
11
+ * ```typescript
12
+ * import * as pulumi from "@pulumi/pulumi";
13
+ * import * as github from "@pulumi/github";
14
+ *
15
+ * const example = new github.Repository("example", {
16
+ * description: "My awesome codebase",
17
+ * autoInit: true,
18
+ * });
19
+ * const development = new github.Branch("development", {
20
+ * repository: example.name,
21
+ * branch: "development",
22
+ * });
23
+ * const _default = new github.BranchDefault("default", {
24
+ * repository: example.name,
25
+ * branch: development.branch,
26
+ * });
27
+ * ```
28
+ *
29
+ * ## Import
30
+ *
31
+ * GitHub Branch Defaults can be imported using an ID made up of `repository`, e.g.
32
+ *
33
+ * ```sh
34
+ * $ pulumi import github:index/branchDefault:BranchDefault branch_default my-repo
35
+ * ```
36
+ */
2
37
  export declare class BranchDefault extends pulumi.CustomResource {
3
38
  /**
4
39
  * Get an existing BranchDefault resource's state with the given name, ID, and optional extra
@@ -15,7 +50,13 @@ export declare class BranchDefault extends pulumi.CustomResource {
15
50
  * when multiple copies of the Pulumi SDK have been loaded into the same process.
16
51
  */
17
52
  static isInstance(obj: any): obj is BranchDefault;
53
+ /**
54
+ * The branch (e.g. `main`)
55
+ */
18
56
  readonly branch: pulumi.Output<string>;
57
+ /**
58
+ * The GitHub repository
59
+ */
19
60
  readonly repository: pulumi.Output<string>;
20
61
  /**
21
62
  * Create a BranchDefault resource with the given unique name, arguments, and options.
@@ -30,13 +71,25 @@ export declare class BranchDefault extends pulumi.CustomResource {
30
71
  * Input properties used for looking up and filtering BranchDefault resources.
31
72
  */
32
73
  export interface BranchDefaultState {
74
+ /**
75
+ * The branch (e.g. `main`)
76
+ */
33
77
  branch?: pulumi.Input<string>;
78
+ /**
79
+ * The GitHub repository
80
+ */
34
81
  repository?: pulumi.Input<string>;
35
82
  }
36
83
  /**
37
84
  * The set of arguments for constructing a BranchDefault resource.
38
85
  */
39
86
  export interface BranchDefaultArgs {
87
+ /**
88
+ * The branch (e.g. `main`)
89
+ */
40
90
  branch: pulumi.Input<string>;
91
+ /**
92
+ * The GitHub repository
93
+ */
41
94
  repository: pulumi.Input<string>;
42
95
  }
package/branchDefault.js CHANGED
@@ -5,29 +5,42 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.BranchDefault = void 0;
6
6
  const pulumi = require("@pulumi/pulumi");
7
7
  const utilities = require("./utilities");
8
+ /**
9
+ * Provides a GitHub branch default resource.
10
+ *
11
+ * This resource allows you to set the default branch for a given repository.
12
+ *
13
+ * Note that use of this resource is incompatible with the `defaultBranch` option of the `github.Repository` resource. Using both will result in plans always showing a diff.
14
+ *
15
+ * ## Example Usage
16
+ *
17
+ * ```typescript
18
+ * import * as pulumi from "@pulumi/pulumi";
19
+ * import * as github from "@pulumi/github";
20
+ *
21
+ * const example = new github.Repository("example", {
22
+ * description: "My awesome codebase",
23
+ * autoInit: true,
24
+ * });
25
+ * const development = new github.Branch("development", {
26
+ * repository: example.name,
27
+ * branch: "development",
28
+ * });
29
+ * const _default = new github.BranchDefault("default", {
30
+ * repository: example.name,
31
+ * branch: development.branch,
32
+ * });
33
+ * ```
34
+ *
35
+ * ## Import
36
+ *
37
+ * GitHub Branch Defaults can be imported using an ID made up of `repository`, e.g.
38
+ *
39
+ * ```sh
40
+ * $ pulumi import github:index/branchDefault:BranchDefault branch_default my-repo
41
+ * ```
42
+ */
8
43
  class BranchDefault extends pulumi.CustomResource {
9
- constructor(name, argsOrState, opts) {
10
- let resourceInputs = {};
11
- opts = opts || {};
12
- if (opts.id) {
13
- const state = argsOrState;
14
- resourceInputs["branch"] = state ? state.branch : undefined;
15
- resourceInputs["repository"] = state ? state.repository : undefined;
16
- }
17
- else {
18
- const args = argsOrState;
19
- if ((!args || args.branch === undefined) && !opts.urn) {
20
- throw new Error("Missing required property 'branch'");
21
- }
22
- if ((!args || args.repository === undefined) && !opts.urn) {
23
- throw new Error("Missing required property 'repository'");
24
- }
25
- resourceInputs["branch"] = args ? args.branch : undefined;
26
- resourceInputs["repository"] = args ? args.repository : undefined;
27
- }
28
- opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
29
- super(BranchDefault.__pulumiType, name, resourceInputs, opts);
30
- }
31
44
  /**
32
45
  * Get an existing BranchDefault resource's state with the given name, ID, and optional extra
33
46
  * properties used to qualify the lookup.
@@ -50,6 +63,28 @@ class BranchDefault extends pulumi.CustomResource {
50
63
  }
51
64
  return obj['__pulumiType'] === BranchDefault.__pulumiType;
52
65
  }
66
+ constructor(name, argsOrState, opts) {
67
+ let resourceInputs = {};
68
+ opts = opts || {};
69
+ if (opts.id) {
70
+ const state = argsOrState;
71
+ resourceInputs["branch"] = state ? state.branch : undefined;
72
+ resourceInputs["repository"] = state ? state.repository : undefined;
73
+ }
74
+ else {
75
+ const args = argsOrState;
76
+ if ((!args || args.branch === undefined) && !opts.urn) {
77
+ throw new Error("Missing required property 'branch'");
78
+ }
79
+ if ((!args || args.repository === undefined) && !opts.urn) {
80
+ throw new Error("Missing required property 'repository'");
81
+ }
82
+ resourceInputs["branch"] = args ? args.branch : undefined;
83
+ resourceInputs["repository"] = args ? args.repository : undefined;
84
+ }
85
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
86
+ super(BranchDefault.__pulumiType, name, resourceInputs, opts);
87
+ }
53
88
  }
54
89
  exports.BranchDefault = BranchDefault;
55
90
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"branchDefault.js","sourceRoot":"","sources":["../branchDefault.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC,MAAa,aAAc,SAAQ,MAAM,CAAC,cAAc;IAuCpD,YAAY,IAAY,EAAE,WAAoD,EAAE,IAAmC;QAC/G,IAAI,cAAc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,KAAK,GAAG,WAA6C,CAAC;YAC5D,cAAc,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;YAC5D,cAAc,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;SACvE;aAAM;YACH,MAAM,IAAI,GAAG,WAA4C,CAAC;YAC1D,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;gBACnD,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;aACzD;YACD,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;gBACvD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;aAC7D;YACD,cAAc,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;YAC1D,cAAc,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;SACrE;QACD,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,CAAC,CAAC;QACnE,KAAK,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IAClE,CAAC;;AAjEL,sCAkEC;AApDG,gBAAgB;AACO,0BAAY,GAAG,0CAA0C,CAAC"}
@@ -1,5 +1,65 @@
1
1
  import * as pulumi from "@pulumi/pulumi";
2
- import { input as inputs, output as outputs } from "./types";
2
+ import * as inputs from "./types/input";
3
+ import * as outputs from "./types/output";
4
+ /**
5
+ * Protects a GitHub branch.
6
+ *
7
+ * This resource allows you to configure branch protection for repositories in your organization. When applied, the branch will be protected from forced pushes and deletion. Additional constraints, such as required status checks or restrictions on users, teams, and apps, can also be configured.
8
+ *
9
+ * ## Example Usage
10
+ *
11
+ * ```typescript
12
+ * import * as pulumi from "@pulumi/pulumi";
13
+ * import * as github from "@pulumi/github";
14
+ *
15
+ * const exampleRepository = new github.Repository("exampleRepository", {});
16
+ * const exampleUser = github.getUser({
17
+ * username: "example",
18
+ * });
19
+ * const exampleTeam = new github.Team("exampleTeam", {});
20
+ * // Protect the main branch of the foo repository. Additionally, require that
21
+ * // the "ci/travis" context to be passing and only allow the engineers team merge
22
+ * // to the branch.
23
+ * const exampleBranchProtection = new github.BranchProtection("exampleBranchProtection", {
24
+ * repositoryId: exampleRepository.nodeId,
25
+ * pattern: "main",
26
+ * enforceAdmins: true,
27
+ * allowsDeletions: true,
28
+ * requiredStatusChecks: [{
29
+ * strict: false,
30
+ * contexts: ["ci/travis"],
31
+ * }],
32
+ * requiredPullRequestReviews: [{
33
+ * dismissStaleReviews: true,
34
+ * restrictDismissals: true,
35
+ * dismissalRestrictions: [
36
+ * exampleUser.then(exampleUser => exampleUser.nodeId),
37
+ * exampleTeam.nodeId,
38
+ * "/exampleuser",
39
+ * "exampleorganization/exampleteam",
40
+ * ],
41
+ * }],
42
+ * pushRestrictions: [
43
+ * exampleUser.then(exampleUser => exampleUser.nodeId),
44
+ * "/exampleuser",
45
+ * "exampleorganization/exampleteam",
46
+ * ],
47
+ * });
48
+ * const exampleTeamRepository = new github.TeamRepository("exampleTeamRepository", {
49
+ * teamId: exampleTeam.id,
50
+ * repository: exampleRepository.name,
51
+ * permission: "pull",
52
+ * });
53
+ * ```
54
+ *
55
+ * ## Import
56
+ *
57
+ * GitHub Branch Protection can be imported using an ID made up of `repository:pattern`, e.g.
58
+ *
59
+ * ```sh
60
+ * $ pulumi import github:index/branchProtection:BranchProtection terraform terraform:main
61
+ * ```
62
+ */
3
63
  export declare class BranchProtection extends pulumi.CustomResource {
4
64
  /**
5
65
  * Get an existing BranchProtection resource's state with the given name, ID, and optional extra
@@ -16,20 +76,57 @@ export declare class BranchProtection extends pulumi.CustomResource {
16
76
  * when multiple copies of the Pulumi SDK have been loaded into the same process.
17
77
  */
18
78
  static isInstance(obj: any): obj is BranchProtection;
79
+ /**
80
+ * Boolean, setting this to `true` to allow the branch to be deleted.
81
+ */
19
82
  readonly allowsDeletions: pulumi.Output<boolean | undefined>;
83
+ /**
84
+ * Boolean, setting this to `true` to allow force pushes on the branch.
85
+ */
20
86
  readonly allowsForcePushes: pulumi.Output<boolean | undefined>;
87
+ /**
88
+ * Boolean, setting this to `true` to block creating the branch.
89
+ */
21
90
  readonly blocksCreations: pulumi.Output<boolean | undefined>;
91
+ /**
92
+ * Boolean, setting this to `true` enforces status checks for repository administrators.
93
+ */
22
94
  readonly enforceAdmins: pulumi.Output<boolean | undefined>;
95
+ /**
96
+ * Boolean, Setting this to `true` will make the branch read-only and preventing any pushes to it. Defaults to `false`
97
+ */
98
+ readonly lockBranch: pulumi.Output<boolean | undefined>;
99
+ /**
100
+ * Identifies the protection rule pattern.
101
+ */
23
102
  readonly pattern: pulumi.Output<string>;
103
+ /**
104
+ * The list of actor Names/IDs that may push to the branch. Actor names must either begin with a "/" for users or the organization name followed by a "/" for teams.
105
+ */
24
106
  readonly pushRestrictions: pulumi.Output<string[] | undefined>;
25
107
  /**
26
- * Node ID or name of repository
108
+ * The name or node ID of the repository associated with this branch protection rule.
27
109
  */
28
110
  readonly repositoryId: pulumi.Output<string>;
111
+ /**
112
+ * Boolean, setting this to `true` requires all conversations on code must be resolved before a pull request can be merged.
113
+ */
29
114
  readonly requireConversationResolution: pulumi.Output<boolean | undefined>;
115
+ /**
116
+ * Boolean, setting this to `true` requires all commits to be signed with GPG.
117
+ */
30
118
  readonly requireSignedCommits: pulumi.Output<boolean | undefined>;
119
+ /**
120
+ * Boolean, setting this to `true` enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch
121
+ */
31
122
  readonly requiredLinearHistory: pulumi.Output<boolean | undefined>;
123
+ /**
124
+ * Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details.
125
+ */
32
126
  readonly requiredPullRequestReviews: pulumi.Output<outputs.BranchProtectionRequiredPullRequestReview[] | undefined>;
127
+ /**
128
+ * Enforce restrictions for required status checks. See Required Status Checks below for details.
129
+ */
33
130
  readonly requiredStatusChecks: pulumi.Output<outputs.BranchProtectionRequiredStatusCheck[] | undefined>;
34
131
  /**
35
132
  * Create a BranchProtection resource with the given unique name, arguments, and options.
@@ -44,39 +141,113 @@ export declare class BranchProtection extends pulumi.CustomResource {
44
141
  * Input properties used for looking up and filtering BranchProtection resources.
45
142
  */
46
143
  export interface BranchProtectionState {
144
+ /**
145
+ * Boolean, setting this to `true` to allow the branch to be deleted.
146
+ */
47
147
  allowsDeletions?: pulumi.Input<boolean>;
148
+ /**
149
+ * Boolean, setting this to `true` to allow force pushes on the branch.
150
+ */
48
151
  allowsForcePushes?: pulumi.Input<boolean>;
152
+ /**
153
+ * Boolean, setting this to `true` to block creating the branch.
154
+ */
49
155
  blocksCreations?: pulumi.Input<boolean>;
156
+ /**
157
+ * Boolean, setting this to `true` enforces status checks for repository administrators.
158
+ */
50
159
  enforceAdmins?: pulumi.Input<boolean>;
160
+ /**
161
+ * Boolean, Setting this to `true` will make the branch read-only and preventing any pushes to it. Defaults to `false`
162
+ */
163
+ lockBranch?: pulumi.Input<boolean>;
164
+ /**
165
+ * Identifies the protection rule pattern.
166
+ */
51
167
  pattern?: pulumi.Input<string>;
168
+ /**
169
+ * The list of actor Names/IDs that may push to the branch. Actor names must either begin with a "/" for users or the organization name followed by a "/" for teams.
170
+ */
52
171
  pushRestrictions?: pulumi.Input<pulumi.Input<string>[]>;
53
172
  /**
54
- * Node ID or name of repository
173
+ * The name or node ID of the repository associated with this branch protection rule.
55
174
  */
56
175
  repositoryId?: pulumi.Input<string>;
176
+ /**
177
+ * Boolean, setting this to `true` requires all conversations on code must be resolved before a pull request can be merged.
178
+ */
57
179
  requireConversationResolution?: pulumi.Input<boolean>;
180
+ /**
181
+ * Boolean, setting this to `true` requires all commits to be signed with GPG.
182
+ */
58
183
  requireSignedCommits?: pulumi.Input<boolean>;
184
+ /**
185
+ * Boolean, setting this to `true` enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch
186
+ */
59
187
  requiredLinearHistory?: pulumi.Input<boolean>;
188
+ /**
189
+ * Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details.
190
+ */
60
191
  requiredPullRequestReviews?: pulumi.Input<pulumi.Input<inputs.BranchProtectionRequiredPullRequestReview>[]>;
192
+ /**
193
+ * Enforce restrictions for required status checks. See Required Status Checks below for details.
194
+ */
61
195
  requiredStatusChecks?: pulumi.Input<pulumi.Input<inputs.BranchProtectionRequiredStatusCheck>[]>;
62
196
  }
63
197
  /**
64
198
  * The set of arguments for constructing a BranchProtection resource.
65
199
  */
66
200
  export interface BranchProtectionArgs {
201
+ /**
202
+ * Boolean, setting this to `true` to allow the branch to be deleted.
203
+ */
67
204
  allowsDeletions?: pulumi.Input<boolean>;
205
+ /**
206
+ * Boolean, setting this to `true` to allow force pushes on the branch.
207
+ */
68
208
  allowsForcePushes?: pulumi.Input<boolean>;
209
+ /**
210
+ * Boolean, setting this to `true` to block creating the branch.
211
+ */
69
212
  blocksCreations?: pulumi.Input<boolean>;
213
+ /**
214
+ * Boolean, setting this to `true` enforces status checks for repository administrators.
215
+ */
70
216
  enforceAdmins?: pulumi.Input<boolean>;
217
+ /**
218
+ * Boolean, Setting this to `true` will make the branch read-only and preventing any pushes to it. Defaults to `false`
219
+ */
220
+ lockBranch?: pulumi.Input<boolean>;
221
+ /**
222
+ * Identifies the protection rule pattern.
223
+ */
71
224
  pattern: pulumi.Input<string>;
225
+ /**
226
+ * The list of actor Names/IDs that may push to the branch. Actor names must either begin with a "/" for users or the organization name followed by a "/" for teams.
227
+ */
72
228
  pushRestrictions?: pulumi.Input<pulumi.Input<string>[]>;
73
229
  /**
74
- * Node ID or name of repository
230
+ * The name or node ID of the repository associated with this branch protection rule.
75
231
  */
76
232
  repositoryId: pulumi.Input<string>;
233
+ /**
234
+ * Boolean, setting this to `true` requires all conversations on code must be resolved before a pull request can be merged.
235
+ */
77
236
  requireConversationResolution?: pulumi.Input<boolean>;
237
+ /**
238
+ * Boolean, setting this to `true` requires all commits to be signed with GPG.
239
+ */
78
240
  requireSignedCommits?: pulumi.Input<boolean>;
241
+ /**
242
+ * Boolean, setting this to `true` enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch
243
+ */
79
244
  requiredLinearHistory?: pulumi.Input<boolean>;
245
+ /**
246
+ * Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details.
247
+ */
80
248
  requiredPullRequestReviews?: pulumi.Input<pulumi.Input<inputs.BranchProtectionRequiredPullRequestReview>[]>;
249
+ /**
250
+ * Enforce restrictions for required status checks. See Required Status Checks below for details.
251
+ */
81
252
  requiredStatusChecks?: pulumi.Input<pulumi.Input<inputs.BranchProtectionRequiredStatusCheck>[]>;
82
253
  }