File tree Expand file tree Collapse file tree
src/main/java/org/kohsuke/github Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -631,6 +631,27 @@ public void delete() throws IOException {
631631 }
632632 }
633633
634+ /**
635+ * Will archive and this repository as read-only. When a repository is archived, any operation
636+ * that can change its state is forbidden. This applies symmetrically if trying to unarchive it.
637+ *
638+ * <p>When you try to do any operation that modifies a read-only repository, it returns the
639+ * response:
640+ *
641+ * <pre>
642+ * org.kohsuke.github.HttpException: {
643+ * "message":"Repository was archived so is read-only.",
644+ * "documentation_url":"https://developer.github.com/v3/repos/#edit"
645+ * }
646+ * </pre>
647+ *
648+ * @throws IOException In case of any networking error or error from the server.
649+ */
650+ public void doArchive () throws IOException {
651+ edit ("archived" , "true" );
652+ archived = true ;
653+ }
654+
634655 /**
635656 * Sort orders for listing forks
636657 */
You can’t perform that action at this time.
0 commit comments