-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add auto archiving action #238
Conversation
6774504
to
203932c
Compare
4dac16d
to
da452de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this something we should do manually? Maybe instead of renaming the branch, rather send an e-mail / alert?
Also, some Python comments in the code.
# Rename inactive branches | ||
for branch in get_branches(): | ||
if is_inactive(branch['commit']['url']): | ||
#rename_branch(branch['name'], f"archived/{branch['name']}") | ||
print(f"[LOG] Branch '{branch['name']}' is inactive and would be renamed to 'archived/{branch['name']}'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add if __name__ == "__main__":
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in a04d09e
Yes we should definitely do this manually. Therefore, I added the 365 days of inactivity. However, some branches are forgotten and I think with our currently 32 branches, we need an additional mechanism. |
Co-authored-by: Martin Lablans <[email protected]>
a04d09e
to
ac0274c
Compare
pull_request: | ||
branches: | ||
- develop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not required anymore, no?
The goal is to automatically archive unused branches (rename to "archived/..." after 365 days of no commit).
Actual code execution is commented (since I don't want to trigger the process until approved)
These branches would be affected:
https://github.com/samply/bridgehead/actions/runs/11340581646/job/31537252148#step:5:10
Will delete this code once ready for merging