Skip to content

Releases: betterup/delete-old-branches-action

v1.0.0

Choose a tag to compare

@cfurrow cfurrow released this 25 Feb 16:41
354173e

Full Changelog: v0.0.19...v1.0.0

This release is equivalent to the v0.0.20 release. We are bumping to 1.0.0 versions, and will attempt to semver from here.

v0.0.20

Choose a tag to compare

@cfurrow cfurrow released this 25 Feb 16:24
354173e

Full Changelog: v0.0.19...v0.0.20

v0.0.19

Choose a tag to compare

@cfurrow cfurrow released this 23 Feb 14:58
03051cb

What's Changed

  • fix: prevent spurious empty batch when branch count is an exact multiple of batch size by @cfurrow in #6

Full Changelog: v0.0.18...v0.0.19

v0.0.18 - Fix gh CLI authentication

Choose a tag to compare

@cfurrow cfurrow released this 02 Dec 15:34
e948f2d

🐛 Bug Fix

Authentication Issue

  • Fixed: "gh: Bad credentials (HTTP 401)" error when using GitHub API
  • Root cause: Git credential configuration was removed when we eliminated git fetch operations
  • Solution: Restored git config for x-access-token authentication that gh CLI relies on

This hotfix restores the authentication setup that allows both git and gh CLI to work properly within the Docker container.

Upgrade Notes

Update your workflow to use @v0.0.18:

uses: betterup/delete-old-branches-action@v0.0.18
uses: betterup/delete-old-branches-action/discovery@v0.0.18

v0.0.17 - Remove git fetch, add discovery filtering and result aggregation

Choose a tag to compare

@cfurrow cfurrow released this 02 Dec 15:25
5294ff7

🚀 Major Performance Improvements

Remove git fetch operations

  • 20+ minute improvement: Eliminated slow git fetch operations by using GitHub API
  • Use gh api "repos/${REPO}/branches/{branch}" to get commit metadata directly
  • Compare dates using epoch timestamps instead of git log --since

Discovery stage filtering

  • 30-50% reduction in branches sent to process stage
  • Pre-filter protected branches, default branches, and PR branches during discovery
  • Reduces API calls and speeds up overall execution
  • New inputs: default_branches, extra_protected_branch_regex, exclude_open_pr_branches

Result aggregation

  • New summary job collects results from all parallel batches
  • Displays formatted markdown summary in GitHub Step Summary
  • Shows total deleted branches and errors across all batches
  • Action outputs: deleted_branches, deleted_count, error_branches, error_count

Bug Fixes

  • Fixed date parsing on Alpine Linux by adding GNU coreutils
  • Added proper error handling for date conversion edge cases
  • Fixed workflow output display by adding step IDs

📚 Documentation

  • Updated MIGRATION.md with discovery filtering examples
  • Added "Understanding Action Outputs" section with usage examples
  • Updated parallel-delete-example.yml with complete workflow pattern

🔧 Technical Changes

  • Added coreutils to Dockerfile for GNU date support
  • Added filtering inputs to discovery/action.yml
  • Enhanced error messages and logging throughout scripts

v0.0.16 - Parallelization Support

Choose a tag to compare

@cfurrow cfurrow released this 01 Dec 19:54
26ed917

🚀 Major Performance Enhancement: Parallelization Support

This release adds parallelization capabilities to fix the recurring 30-minute timeout issue in large repositories.

⚡ Performance Impact

Before (Single Job):

  • ❌ 30+ minutes → Timeout failure
  • Fetches ALL branches sequentially
  • Single monolithic job

After (Parallelized):

  • ✅ 5-6 minutes → Success
  • Fetches only needed branches per job
  • Multiple parallel workers
  • 5-6x faster execution

🎯 What's New

New Features

  • Branch Discovery Script (discover-branches): Fast branch listing via git ls-remote with batching
  • Batch Mode: Process specific branch lists instead of all branches
  • Parallelized Workflow Pattern: Two-stage architecture (discovery → parallel processing)
  • Discovery Action: Available at betterup/delete-old-branches-action/discovery@v0.0.16

New Input Parameters

  • branch_list: Space-separated list of branches to process (enables batch mode)
  • batch_size: Number of branches per batch (discovery action)

Docker Image Updates

  • Added jq for JSON processing
  • Includes new discover-branches script

📚 Documentation

  • README.md: Added comprehensive parallelization guide
  • MIGRATION.md: Step-by-step migration instructions
  • Example Workflow: .github/workflows/parallel-delete-example.yml

🔄 Backward Compatibility

✅ Fully backward compatible - All existing workflows continue to work unchanged. Parallelization is opt-in via the new workflow pattern.

📖 Quick Start

For repositories experiencing timeouts, see the parallelization guide in the README or follow the migration guide.

Example parallelized workflow:

jobs:
  # Stage 1: Discover branches and create batches
  discover:
    runs-on: ubuntu-latest
    outputs:
      matrix: ${{ steps.discover.outputs.matrix }}
    steps:
      - name: Discover branches
        id: discover
        uses: betterup/delete-old-branches-action/discovery@v0.0.16
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          batch_size: "100"

  # Stage 2: Process branches in parallel
  process:
    needs: discover
    runs-on: ubuntu-latest
    strategy:
      max-parallel: 10
      matrix: ${{ fromJson(needs.discover.outputs.matrix) }}
    steps:
      - uses: actions/checkout@v4
      - uses: betterup/delete-old-branches-action@v0.0.16
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          date: "60 days ago"
          branch_list: ${{ matrix.branches }}

📦 Commits

  • feat: add branch discovery script for parallelization
  • feat: add batch mode support to delete-old-branches
  • build: add jq and discover-branches to Docker image
  • feat: add branch_list input parameter for batch processing
  • docs: add example parallelized workflow
  • docs: add parallelization guide and migration documentation
  • fix: correct action usage in documentation
  • fix: output compact single-line JSON for GitHub Actions

🔧 Bug Fixes in v0.0.16

  • Fixed incorrect Docker image references in documentation
  • Moved discovery action to subdirectory structure (discovery/action.yml)
  • Corrected input parameter names in examples
  • Fixed multi-line JSON output causing GitHub Actions parsing errors

🙏 Acknowledgments

Built to solve timeout issues in large monorepos with 1000+ branches.

Full Changelog: v0.0.15...v0.0.16

v0.0.15 Release

Choose a tag to compare

@cfurrow cfurrow released this 24 Nov 17:08
6f5a955

Critical fix for git authentication in Docker containers. Configures git to use GITHUB_TOKEN for authentication, resolving 'could not read Username' errors when fetching from within the action's Docker container.

v0.0.14 Release

Choose a tag to compare

@cfurrow cfurrow released this 24 Nov 16:56
1caa523

Performance optimization to prevent timeouts on large repositories by skipping unnecessary tag fetching during branch cleanup operations. Tags are now only fetched when DELETE_TAGS=true. #3

v0.0.13 Release

Choose a tag to compare

@cfurrow cfurrow released this 24 Nov 16:57
482f101

Performance improvement to cache open PR branches and eliminate redundant API calls during branch cleanup operations. #2

v0.0.12 Release

Choose a tag to compare

@cfurrow cfurrow released this 03 Oct 16:08
bf1e044

Includes bugfix to more gracefully handle a few git-related errors we'd seen in our CI environment: #1