-
Notifications
You must be signed in to change notification settings - Fork 736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement archive/unarchive functionality #472
Comments
would it not be more intuitive to name the method simply |
Hi. Could be, but archive is both a verb and a noun so for me at least, naming something as |
I think that if we want to be very explicit, the most java-style way to do it would be |
Hi again. Been a bit away. Are you one of the project maintainers ? |
No, sadly I'm just someone who is interested in having this functionality implemented. |
+1. This would be very nice to have. |
I changed the method name to |
Just coincidentally found this and wanted to leave a note that unarchiving via API is now possible: https://github.blog/changelog/2022-12-13-unarchive-a-repository-via-the-rest-api/ |
@lumaxis |
Howdy.
GHRepository
does not have an archive/unarchive feature.To archive, a
GitHub.edit("archived", "true")
call is enough.To unarchive, it is not possible from the REST API and need to be done manually in the web UI.
In case someone wants to implement an unarchive API:
send a POST request to
https://github.com/<organization>/<repository>/settings/archive
orhttps://github.com/<organization>/<repository>/settings/unarchive
. The POST body contains:utf8=%E2%9C%93&authenticity_token=...&verify=<repository>
. The tokenauthenticity_token
is embedded in the HTML in the html form.This will force to use a different set of URLs and scrape some HTML, so lets consider this out of scope.
The text was updated successfully, but these errors were encountered: