Housekeeping actions#

Housekeeping actions provide for general repository operations such as package cleanup.

Package cleanup of untagged versions#

Action cleaning up untagged package versions published at ghcr.io. Source code for this action

Input

Description

Required

Type

Default

package-name

Package name.

True

string

token

Token with package deletion permissions.

True

string

package-org

Organization at which packages are published.

False

string

ansys

allow-last-days

Avoid removing the last N days images: e.g. ‘2’.

False

string

python-version

Desired Python version.

False

string

3.10

Examples#

Perform untagged versions cleanup
hk-package-clean-untagged:
  name: "Perform untagged versions cleanup"
  runs-on: ubuntu-latest
  steps:
    - name: "Perform untagged versions cleanup"
      uses: ansys/actions/hk-package-clean-untagged@v8.1
      with:
        package-name: 'mypackage'
        token: ${{ secrets.GITHUB_TOKEN }}

Package cleanup excluding certain versions#

Action cleaning up all package versions published at ghcr.io except for certain tags. Source code for this action

Input

Description

Required

Type

Default

package-name

Package name.

True

string

token

Token with package deletion permissions.

True

string

tags-kept

Tags to be kept. Pass them as a list: e.g. ‘latest, latest-unstable’.

True

string

package-org

Organization at which packages are published.

False

string

ansys

allow-last-days

Avoid removing the last N days images: e.g. ‘2’.

False

string

python-version

Desired Python version.

False

string

3.10

Examples#

Perform versions cleanup - except certain tags
hk-package-clean-except:
  name: "Perform versions cleanup - except certain tags"
  runs-on: ubuntu-latest
  steps:
    - name: "Perform versions cleanup - except certain tags"
      uses: ansys/actions/hk-package-clean-except@v8.1
      with:
        package-name: 'mypackage'
        token: ${{ secrets.GITHUB_TOKEN }}
        tags-kept: 'latest, latest-unstable'