Skip to content

[Feature Request]: Automatically clean up per-branch directories on the storage branch for deleted branches #54

@whme

Description

@whme

Feature description

Description

Currently, the coverage-action uses a dedicated storage branch (_xml_coverage_reports by default) to persist coverage reports for diff purposes, with one directory per branch.
Over time, as pull requests are merged and branches deleted, these directories accumulate and are no longer relevant.

Proposed feature

It would be useful if the action could automatically clean up old per-branch directories corresponding to branches that no longer exist on the remote.

A possible approach:

  1. When the action runs (e.g. during a PR build), it fetches the list of directories in the configured storage branch.
  2. It also retrieves the list of current remote branches.
  3. It compares the two lists.
  4. Any directories that don’t match an existing branch name can be safely deleted.
  5. The cleanup could then be committed and pushed automatically, or optionally gated behind a configuration flag (e.g. cleanup-diff-storage: true).

I am not sure if this type of automatic cleanup would be in scope for this action, looking forward to hearing your feedback!

If you feel like this would be useful I can provide a PR.

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions