[go: nahoru, domu]

Skip to content
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

Dev/alpha #708

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
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
Next Next commit
Create delete-old-branches.yaml
  • Loading branch information
mdv-devops committed Apr 6, 2023
commit f6137b4e3961e61b5ad86784749526bf212c1a90
29 changes: 29 additions & 0 deletions .github/workflows/delete-old-branches.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Delete abandoned branches

on:
# Run daily at midnight
schedule:
- cron: "0 0 * * *"

# Allow workflow to be manually run from the GitHub UI
workflow_dispatch:

jobs:
cleanup_old_branches:
runs-on: ubuntu-latest
name: Satisfy my repo CDO
steps:
- name: Delete those pesky dead branches
uses: phpdocker-io/github-actions-delete-abandoned-branches@v1
id: delete_stuff
with:
github_token: ${{ github.token }}
last_commit_age_days: 100
ignore_branches: next-version,dont-deleteme
github_base_url: https://github.mycompany.com/api/v3

# Disable dry run and actually get stuff deleted
dry_run: no

- name: Get output
run: "echo 'Deleted branches: ${{ steps.delete_stuff.outputs.deleted_branches }}'"