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 or https://github.com/<organization>/<repository>/settings/unarchive. The POST body contains:
utf8=%E2%9C%93&authenticity_token=...&verify=<repository>. The token authenticity_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.
Howdy.
GHRepositorydoes 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/archiveorhttps://github.com/<organization>/<repository>/settings/unarchive. The POST body contains:utf8=%E2%9C%93&authenticity_token=...&verify=<repository>. The tokenauthenticity_tokenis 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.