File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ Creating resources at the organization level
2+
3+ In order to create resources in GitHub for a given organization, you must first create an object of type <<<GHOrganization>>>.
4+ As an example:
5+
6+ +-----+
7+ GHOrganization organizationClient(GitHub gitHub, String organizationName) throws IOException {
8+ return gitHub.getOrganization(organizationName);
9+ }
10+ +-----+
11+
12+ Now you can easily work with the GHOrganization, and all methods that will create resources will create them
13+ in the given organization.
14+
15+ One of the most common use cases is to create a repository in a given organization:
16+
17+ +-----+
18+ void createRepository(GHOrganization organization) {
19+ organization.createRepository("repository-name")
20+ .private_(true)
21+ .wiki(false)
22+ .projects(false)
23+ .description("Description")
24+ .allowMergeCommit(true)
25+ .allowSquashMerge(false)
26+ .allowRebaseMerge(false)
27+ .create()
28+ }
29+ +-----+
30+
31+
Original file line number Diff line number Diff line change 2323 <item name =" JWT Authentication" href =" /githubappjwtauth.html" />
2424 <item name =" App Installation Token " href =" /githubappappinsttokenauth.html" />
2525 </item >
26+ <item name =" Working with organizations" href =" /createorglevelresources.html" />
2627 </menu >
2728
2829 <menu name =" References" >
You can’t perform that action at this time.
0 commit comments