GitHub action to determine and delete existing versions of GitHub packages.
The application can handle versions of the type <major>.<minor>.<patch> or <major>.<minor>.<patch>-SNAPSHOT. If minor or patch are missing they will be handled as zero.
🚀 This action uses Ma-Vin/packages-action-app to process the main logic. The golang binary will be downloaded from release v1.1.1
🐤 👷 This repository and Ma-Vin/packages-action-app are just a try out of GitHub Action, GoLang and GitHub rest api. In normal case the process logic of this use case won't be split into two Node.js and GoLang applications.
The binaries of the GoLang project are compiled and released for the following combinations:
Default "https://api.github.com" - Protocol and host of the GitHub rest api.
Required - The access token to use for bearer authentication against GitHub rest api.
Default true - Indicator whether to print deletion candidates only or to delete versions/package.
Required - GitHub user who is the owner of the packages.
Required - The type of package. At the moment only maven is supported (In general there exists npm, maven, rubygems, docker, nuget, container).
Required - The name of the package whose versions should be deleted.
A concrete version to delete (Independent of number_major_to_keep number_minor_to_keep and number_patch_to_keep).
Default false - Indicator whether to delete all snapshots or none (Snapshots are excluded from number_major_to_keep number_minor_to_keep and number_patch_to_keep)
Positive number of major versions to keep.
Positive number of minor versions to keep (within a major version).
Positive number of patch versions to keep (within a minor version).
Default false - Indicator whether to log addtional logs (At the moment only header information in case of rest call failure will be logged).
Default 3 - Client timeout for rest calls.
At least one deletion indicator of version_name_to_delete, delete_snapshots, number_major_to_keep number_minor_to_keep or number_patch_to_keep must be set.
Delete major, minor and patch versions of the maven package com.github.ma-vin.examplepackage at Ma-Vin user
packages with github token from repository secrets (Using secrets in GitHub Actions)
uses: ma-vin/packages-action@v1.0
with:
github_token: '${{ secrets.PersonalAccessTokenAtSecret }}'
dry_run: false
github_user: 'Ma-Vin'
package_type: 'maven'
package_name: 'com.github.ma-vin.examplepackage'
number_major_to_keep: 3
number_minor_to_keep: 2
number_patch_to_keep: 1Test run for all snapshot versions of the maven package com.github.ma-vin.examplepackage at Ma-Vin user
packages, but without deleting them:
uses: ma-vin/packages-action@v1.0
with:
github_token: '${{ secrets.PersonalAccessTokenAtSecret }}'
dry_run: true
github_user: 'Ma-Vin'
package_type: 'maven'
package_name: 'com.github.ma-vin.examplepackage'
delete_snapshots: true