Skip to content

GitHub Action to clean version tags from a repository. It works both for User and Organisation repositories.

License

Notifications You must be signed in to change notification settings

Savrov/github-action-version-cleaner

Repository files navigation

Version Cleaner

Unit tests

GitHub Action to clean version tags from a repository. It works both for User and Organisation repositories.

Usage

Include the following step in your workflow to delete all SNAPSHOT packages from your repository.

- name: Delete SNAPSHOT packages
  uses: Savrov/github-action-version-cleaner@release/1.0.0
  with:
    github-repository: ${{ github.repository }}
    package-type: maven
    version-tag: SNAPSHOT
    is-version-tag-strict: true
    github-token: ${{ secrets.DELETE_PACKAGES_TOKEN }}

Inputs

  • github-repository: The repository to clean. Not Required. Default: ${{ github.repository }}
  • package-type: The type of package to clean. Required.
  • version-tag: The version tag to clean. Not Required. Default: SNAPSHOT
  • is-version-tag-strict: Whether to use strict matching for version tag. Not Required. Default: true
  • github-token: The token to use to authenticate with Github API. Required. See Token generation for more information.

Token generation

Since this action deletes packages, it requires a token with delete permission. Follow the steps in official documentation to create a personal access token with the following permissions:

  • read:packages
  • delete:packages
  • read:project
  • repo (if package-type is container)

After creating a new token, do not forget to add it to your repository's secrets. Then, use it in your workflow as shown in the Usage section.

P.S. Default ${{ secrets.GITHUB_TOKEN }} is not suitable for this action, because it has not enough permissions to read a package's repository data.

About

GitHub Action to clean version tags from a repository. It works both for User and Organisation repositories.

Topics

Resources

License

Stars

Watchers

Forks

Languages