GitHub Action to clean version tags from a repository. It works both for User and Organisation repositories.
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 }}
- 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.
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.