mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-10 08:21:21 +00:00
added command to disable Wiki
This commit is contained in:
@@ -207,6 +207,14 @@ public class GHRepository {
|
||||
.to("/repos/show/" + owner + "/" + name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables Wiki for this repository.
|
||||
*/
|
||||
public void enableWiki(boolean v) throws IOException {
|
||||
new Poster(root).withCredential().with("values[has_wiki]",String.valueOf(v))
|
||||
.to("/repos/show/" + owner + "/" + name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes this repository.
|
||||
*/
|
||||
|
||||
@@ -41,8 +41,10 @@ public class AppTest extends TestCase {
|
||||
|
||||
public void testApp() throws IOException {
|
||||
GitHub gitHub = GitHub.connect();
|
||||
GHPullRequest i = gitHub.getOrganization("jenkinsci").getRepository("parameterized-trigger-plugin").getPullRequest(3);
|
||||
System.out.println(i);
|
||||
|
||||
// tryDisablingIssueTrackers(gitHub);
|
||||
|
||||
// tryDisablingWiki(gitHub);
|
||||
|
||||
// GHPullRequest i = gitHub.getOrganization("jenkinsci").getRepository("sandbox").getPullRequest(1);
|
||||
// for (GHIssueComment c : i.getComments())
|
||||
@@ -87,6 +89,15 @@ public class AppTest extends TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
private void tryDisablingWiki(GitHub gitHub) throws IOException {
|
||||
for (GHRepository r : gitHub.getOrganization("jenkinsci").getRepositories().values()) {
|
||||
if (r.hasWiki()) {
|
||||
System.out.println("DISABLED "+r.getName());
|
||||
r.enableWiki(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void tryUpdatingIssueTracker(GitHub gitHub) throws IOException {
|
||||
GHRepository r = gitHub.getOrganization("jenkinsci").getRepository("lib-task-reactor");
|
||||
System.out.println(r.hasIssues());
|
||||
|
||||
Reference in New Issue
Block a user