Skip to content

Provide option to clean local tags #715

@randymarsh77

Description

@randymarsh77

I saw a handful of issues related to "tags", but not this specifically.

Problem:
Some tools (e.g. semantic-release) will create a local tag (e.g. for a new release), and then push the tag, and then perform an operation (e.g. the release). If the push or the operation fails, the local tag will remain in the checkout on the runner.

actions/checkout provides options to clean the checkout, but this clean does not delete local tags (for good reason), so these are for all intents and purposes "leaked artifacts" from a previous run.

It's possible that fetch-depth: 0 might have an effect on local tags (I haven't tested this, and in any case, fetch-depth: 1 will still have this problem).

There is also this related issue: #701 which could provide a solution provided local tags are cleaned up when (re)fetching tags.

Proposition:
Either leverage the existing fetch-depth and clean options to remove local tags in an appropriate way for those options, or add additional opt-in configuration to clean tags (and, fetch tags outside of fetch-depth).

Re "appropriate way": I would expect a checkout that does clean and does not have fetch-depth: 0 to not have any local tags after actions/checkout runs, so it seems safe to delete all the local tags automatically in this scenario. However, that might be an undesirable change to previous behavior.

Thank you for your consideration!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions