Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1f8e732

Browse filesBrowse files
committed
added command to disable Wiki
1 parent d5e52a2 commit 1f8e732
Copy full SHA for 1f8e732

File tree

Expand file treeCollapse file tree

2 files changed

+21
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+21
-2
lines changed

‎src/main/java/org/kohsuke/github/GHRepository.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHRepository.java
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,14 @@ public void enableIssueTracker(boolean v) throws IOException {
207207
.to("/repos/show/" + owner + "/" + name);
208208
}
209209

210+
/**
211+
* Enables or disables Wiki for this repository.
212+
*/
213+
public void enableWiki(boolean v) throws IOException {
214+
new Poster(root).withCredential().with("values[has_wiki]",String.valueOf(v))
215+
.to("/repos/show/" + owner + "/" + name);
216+
}
217+
210218
/**
211219
* Deletes this repository.
212220
*/

‎src/test/java/org/kohsuke/AppTest.java

Copy file name to clipboardExpand all lines: src/test/java/org/kohsuke/AppTest.java
+13-2Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ public void testMembership() throws Exception {
4141

4242
public void testApp() throws IOException {
4343
GitHub gitHub = GitHub.connect();
44-
GHPullRequest i = gitHub.getOrganization("jenkinsci").getRepository("parameterized-trigger-plugin").getPullRequest(3);
45-
System.out.println(i);
44+
45+
// tryDisablingIssueTrackers(gitHub);
46+
47+
// tryDisablingWiki(gitHub);
4648

4749
// GHPullRequest i = gitHub.getOrganization("jenkinsci").getRepository("sandbox").getPullRequest(1);
4850
// for (GHIssueComment c : i.getComments())
@@ -87,6 +89,15 @@ private void tryDisablingIssueTrackers(GitHub gitHub) throws IOException {
8789
}
8890
}
8991

92+
private void tryDisablingWiki(GitHub gitHub) throws IOException {
93+
for (GHRepository r : gitHub.getOrganization("jenkinsci").getRepositories().values()) {
94+
if (r.hasWiki()) {
95+
System.out.println("DISABLED "+r.getName());
96+
r.enableWiki(false);
97+
}
98+
}
99+
}
100+
90101
private void tryUpdatingIssueTracker(GitHub gitHub) throws IOException {
91102
GHRepository r = gitHub.getOrganization("jenkinsci").getRepository("lib-task-reactor");
92103
System.out.println(r.hasIssues());

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.