forked from arc90/git-sweep
-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yaml
37 lines (37 loc) · 1.5 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Git Sweep Merged and Stale
author: rodvdka
description: Py 3.6+. Deletes old branches older than X days and merged branches. Based on `git-sweep`.
inputs:
warning:
description: 'You require Python 3.6+ to run this. See example https://github.com/rodvdka/git-sweep-merged-and-stale/blob/master/preview.yml'
required: true
default: ''
delete_stale_after_days:
description: 'After how many days should a branch be stale `X`?'
required: true
default: '365'
action:
description: 'Type of action? ("preview" (dry-run) or "cleanup")'
required: true
default: 'preview'
skip:
description: 'Comma seperated string list of branches to ignore'
required: false
default: "main,develop,master"
which_master_main:
description: 'The name of what you consider the main or master branch'
required: false
default: "master"
runs:
using: composite
steps:
- id: python-36-above
run: python -c "import sys; print(sys.version); assert sys.version_info >= (3, 6), 'Use Python 3.6 or newer'"
shell: bash
- id: install-run-git-sweep-merged-and-stale
run:
sudo apt-get install git && cd ${{ github.action_path }} && pip install . --user && cd ${{ github.workspace }} && PATH="$PATH:/home/runner/.local/bin" git-sweep-merged-and-stale ${{ inputs.action }} --force --master ${{ inputs.which_master_main }} --skip ${{ inputs.skip }} --delete_stale_after_days ${{ inputs.delete_stale_after_days }}
shell: bash
branding:
icon: 'archive'
color: 'white'