Rollback

Rollback

Rollback the master branch to the previous commit

67 followers

A github action to manually rollback the master branch to the previous commit, creating a timestamped backup branch for recovery.
Rollback gallery image
Rollback gallery image
Rollback gallery image
Rollback gallery image
Free
Launch Team
Universal-3 Pro by AssemblyAI
Universal-3 Pro by AssemblyAI
The first promptable speech model for production
Promoted

What do you think? …

Raiyan Yahya
Maker
📌
A github action to manually rollback the master branch to the previous commit, creating a timestamped backup branch for recovery. ⚠ Warning This action force pushes to the master branch, which can cause issues for other collaborators. Use with caution and ensure you understand the implications of removing a commit before proceeding. This action is for developers and teams who want and immediate rollback of their master branch. Running this action will change master and rewrite the commit history. Changes will be lost forever. Be very careful and sure whe you use this. DO NOT use this action if you are still unclear as to what this does. Why ? Its so common that we mess up or do a bad commit / merge on the master branch and we want to rollback production. It causes panic and frustration. Using this action anyone in the team who has permissions on the repo can perform a rollback of the master branch. It can save time and be very handy when under a lot of stress. How it works: The action checks if it's running as a workflow dispatch event. If not, it exits with an error. The action authenticates with GitHub using the provided token. The repository is cloned, and the action checks if the current branch is master. If not, it exits with an error. A new backup branch with a timestamp in its name is created and pushed to the remote repository. The master branch is rolled back to the previous commit, and the updated master branch is force pushed to the remote repository. The action cleans up the temporary repository directory. Limitations and Potential Issues: Force pushing: Force pushing to the master branch is generally discouraged, as it can cause confusion and issues for other collaborators. Loss of history: Since the action erases the history of the current commit, you may lose important changes or context if you do not carefully review the backup branch before using this action. Limited to the master branch: This action is hardcoded to work only on the master branch. You may need to modify the action to support different branch names or make the branch name configurable. Permission issues: The action requires a GitHub token with sufficient permissions to clone the repository, create and push branches, and force push to the master branch. If the token does not have the required permissions, the action will fail.
Tornike Tsiramua
@raiyanyahya A GitHub action for manual rollback with timestamped backup sounds like a valuable tool for ensuring code safety and recovery. Great work on creating this solution! Congrats guys!
Raiyan Yahya
Cool idea, but: Does this reset the master/main branch? Rewriting the git history for the master branch will most likely mess up the local branch for everyone working on this project and all of their other branches. Why not just revert the last commit? Saves you a lot of trouble. "git revert HEAD"
Raiyan Yahya
@timobechtel yes you are right. the main reason for doing this is urgency, directly from a github action. Typically you would not run this on a project worked on by many people. This is for quick production deploy rollbacks but yes this is discouraged. I wrote the same in the description.
@raiyanyahya You clearly added a lot of warnings :) You probably know what you are doing, but others might not. That's why I felt the urge to write this comment.
Neel Patel 🦕
@raiyanyahya Developer tools have the highest potential of succeeding over here since PH community has a majority of makers. Good luck with your launch today!
Raiyan Yahya
@neelptl2602 thank you!
Hikaru Nagashima
so good
Raiyan Yahya
Rami
Great share, I personally do everything on my local because I am a git OG.
Raiyan Yahya
@kingromstar even better!
George J. Burns
Congrats on the launch! I will give it a try
Raiyan Yahya
@george_j_burns thank you!
Mateenah M
Very useful when wanting emergency rollbacks of the master. Scary but useful. Good job.
Raiyan Yahya
@mateenah_m thank you
12
Next
Last