'Reset/Revert back with Pygithub
Can someone please point me to documentation on pygithub for rolling back the last commit? or reverting back to a previous specific commit? For some reason, I cannot find it.
Some context: I have written a flask app for a POC. My github repo has only the master branch. And, I am using Pygithub to commit the files to my githubrepo.
So in my flask app, I have got the following working. a. User wants to create a resource. So user enters some info on a html form, backend app consumes it and file gets committed to git b. User wants to modify the resource, So user enters updated info, again, the same flow, backend app consumes it and file gets committed to git c. User wants to remove the resource. So user enters name of resource and the flow works the same way, eventually, the file gets whacked out from the github repo
I am using terraform cloud in this project. So as soon as myrepo in github sees some action, like a file being created or removed, the terraform cloud workspace picks it up and runs and provisions the resource in the thirdparty site.
The reason I need the rollback/revert logic is:
For some reason, terraform workspace run fails, I wanna capture the specific commit_id and give the option to rollback on the html form. So user watches/sees the terraform run status, and when the user sees "errored", the user will have a button on the form that says - "Click here to rollback to the previous working version". And, maybe more verbose information as well like - Please fix your configuration and try and reprovision later or something like that...
Thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
