Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Look up all branches on repo by prefix. Days threshold for deleting stale branches #17

Open
wants to merge 51 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
e64edcd
Look up all the branches by prefix and load them up for deletion
bryanjebyrd Dec 19, 2020
fa87b1b
Update action.yml
bryanjebyrd Dec 19, 2020
5d4160b
add safeguards for owner and repo to be present
bryanjebyrd Dec 19, 2020
a13ce81
Create test-prefix-owner-repo.yml
bryanjebyrd Dec 19, 2020
5505b88
Update test-prefix-owner-repo.yml
bryanjebyrd Dec 19, 2020
1b77d1f
different starts with function call
bryanjebyrd Dec 19, 2020
a9206af
fixing the string function on an object :facepalm:
bryanjebyrd Dec 19, 2020
29d534e
removing log statement
bryanjebyrd Dec 19, 2020
f26746c
sleep it 30 to not clash with other action
bryanjebyrd Dec 19, 2020
358e1ef
make test branch names completely different
bryanjebyrd Dec 19, 2020
b51b129
adding some logging for more visual
bryanjebyrd Dec 19, 2020
b8afbb2
forgot the await :facepalm:
bryanjebyrd Dec 19, 2020
b22dd85
use standard prefix + branch when owner and repo is not present
bryanjebyrd Dec 19, 2020
558dab8
Update README.md
bryanjebyrd Dec 19, 2020
ae1dd1f
adding test branches
bryanjebyrd Dec 19, 2020
8360c77
add dry-run capability
bryanjebyrd Dec 20, 2020
11b368c
fixing syntax error
bryanjebyrd Dec 20, 2020
520399f
attempting to use github context
bryanjebyrd Dec 20, 2020
081a563
fixing the call to the github context
bryanjebyrd Dec 20, 2020
ea69222
removing owner and repo input, got it from the ctx obj
bryanjebyrd Dec 20, 2020
1ffa5cb
fixing another syntax error
bryanjebyrd Dec 20, 2020
bc59236
adding dry_run input
bryanjebyrd Dec 20, 2020
fe1e3bd
Removing repo and owner from readme
bryanjebyrd Dec 20, 2020
a8a00e5
removing prefix check in the delete loop
bryanjebyrd Dec 20, 2020
9ada54b
removing unneeded inputs
bryanjebyrd Dec 20, 2020
9e43595
fixing dry_run input
bryanjebyrd Dec 20, 2020
d203a5e
Update and rename test.yml to suffix-test.yml
bryanjebyrd Dec 20, 2020
785e21f
Rename test-prefix-owner-repo.yml to prefix-test.yml
bryanjebyrd Dec 20, 2020
d27ca37
Update action.yml
bryanjebyrd Dec 20, 2020
9989639
adding days input
bryanjebyrd Dec 20, 2020
22ff4f6
completed days functionality...now to test
bryanjebyrd Dec 20, 2020
18fb6a9
Create days-test.yml
bryanjebyrd Dec 20, 2020
7e2d339
Update prefix-test.yml
bryanjebyrd Dec 20, 2020
1bc1acf
target all branches for action
bryanjebyrd Dec 20, 2020
00c31fe
creating test to validate days input
bryanjebyrd Dec 20, 2020
4528196
updating test
bryanjebyrd Dec 20, 2020
a6a0d77
add logging for visual aid
bryanjebyrd Dec 20, 2020
aff4884
fixing the chaining in the json return obj
bryanjebyrd Dec 20, 2020
845968b
remove logging
bryanjebyrd Dec 20, 2020
05c69e0
Update and rename days-test.yml to negative-days-test.yml
bryanjebyrd Dec 20, 2020
dbef3fe
Create positive-days-test.yml
bryanjebyrd Dec 20, 2020
c31b1e9
adding logging for visual
bryanjebyrd Dec 20, 2020
79de717
run on all branches
bryanjebyrd Dec 20, 2020
937aea6
run on all branches
bryanjebyrd Dec 20, 2020
69b29a6
more visual aid with logs
bryanjebyrd Dec 20, 2020
ab278b2
convert the string date to date for compare
bryanjebyrd Dec 20, 2020
f8d364c
logging coming up.
bryanjebyrd Dec 20, 2020
1f216dc
fixing the date comparison
bryanjebyrd Dec 20, 2020
246fe32
moving around the logging to make the output cleaner
bryanjebyrd Dec 20, 2020
72db792
adding days example
bryanjebyrd Dec 20, 2020
66c6b45
Merge pull request #1 from bryanjebyrd/days-input
bryanjebyrd Dec 20, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adding days example
bryanjebyrd authored Dec 20, 2020
commit 72db79249ab699bf597bff93ec43335b07856129
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Delete multiple branches GitHub Action

An action that deletes multiple branches from repository.
Optionally one can provide a `prefix` or `suffix` strings that would be appended or prepended to every branch name.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removing prefix here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous prefix was replaced with lookups against all the repo branches. The previous implementation users of the action had to explicitly know the branch name.

Optionally one can provide a `suffix` strings that would be appended or prepended to every branch name.

## Usage

@@ -25,4 +25,9 @@ Optionally one can provide a `prefix` or `suffix` strings that would be appended
github_token: ${{github.token}}
branches: test
suffix: -done
- name: Delete branches older than 10 days
uses: dawidd6/action-delete-branch@v3
with:
github_token: ${{github.token}}
days: 10
```