Skip to content
archive

GitHub Action

Git Sweep Merged and Stale

latest Latest version

Git Sweep Merged and Stale

archive

Git Sweep Merged and Stale

Py 3.6+. Deletes old branches older than X days and merged branches. Based on `git-sweep`

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Git Sweep Merged and Stale

uses: rod-dot-codes/git-sweep-merged-and-stale@latest

Learn more about this action in rod-dot-codes/git-sweep-merged-and-stale

Choose a version

Git Sweep Merged and Stale Github Action

Delete merged and stale branches from a Github repository.

See example Preview and Cleanup step.

You need to use Python 3.6+ and declare it before

uses: actions/setup-python@v2
with:
    python-version: '3.x'
    architecture: 'x64'
This deletes branches that fulfil either of these:
  • Merged into Master or Main (specified by which_master_main) OR
  • Branches older than X days (specified by delete_stale_after_days)

This by default does not actually delete until you set parameter action = cleanup

The following branches are not deleted by default:
  • main
  • develop
  • master
WARNING: When you delete branches with no active PR,
you will lose access to the ability to restore the branch.
Please back it up using Github Artifacts or
a copy of the branch prior to running this.

Read the Python Readme . PyPi version available for PIP.

Based off git-sweep .

MIT License.