Skip to content

Reset a given branch to another given branch

License

sologeek/action-reset-repo

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reset Git Branch

Reset a specific branch to another. Useful if you need a specific branch to be reset to say main at given intervals. NOTE: this action performs a reset on the repository and is destructive - you will lose any changes made to the branch being reset. Be sure this is what you want to do before running.

Usage

Example Workflow using a schedule.

name: Rest Dev Branch to Main at 1am each day
on:
  schedule:
    - cron: "0 1 * * *"
jobs:
  reset:
    name: Runner
    runs-on: ubuntu-latest
    steps:
      - name: Reset dev branch to main
        uses: nicksnell/action-reset-repo@main
        with:
          reset_branch: dev

Inputs

name value default description
github_token string Token for the repo. Can be passed in using ${{ secrets.GITHUB_TOKEN }}.
base_branch string 'main' Branch to be used to reset too
reset_branch string - Determines the branch to be reset

License

The Dockerfile and associated scripts and documentation in this project are released under the MIT License.

About

Reset a given branch to another given branch

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 85.6%
  • Dockerfile 14.4%