57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
name: "package cleanup"
|
|
description: "Cleans up old packages and versions"
|
|
|
|
inputs:
|
|
url:
|
|
description: "Server URL"
|
|
required: true
|
|
names:
|
|
description: "Names of packages"
|
|
required: true
|
|
owner:
|
|
description: "Owner of the package"
|
|
required: true
|
|
types:
|
|
description: "Types of packages (e.g. Container, PyPi, NuGet)"
|
|
required: false
|
|
default: "Container,PyPi,NuGet"
|
|
api_token:
|
|
description: "API token for authentication"
|
|
required: true
|
|
dry_run:
|
|
description: "Execute without deleting packages"
|
|
required: false
|
|
default: "false"
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Download and test package-cleanup tool
|
|
shell: bash
|
|
run: |
|
|
latest_path=$(curl -sI https://git.sh-edraft.de/sh-edraft.de/-/packages/generic/package-cleanup/ \
|
|
| awk -F ' ' '/Location:/ {print $2}' \
|
|
| tr -d '\r')
|
|
|
|
version=$(basename "$latest_path")
|
|
echo "Downloading package-cleanup version $version..."
|
|
curl -OJ https://git.sh-edraft.de/api/packages/sh-edraft.de/generic/package-cleanup/$version/package-cleanup-linux-x64
|
|
|
|
# Make executable
|
|
chmod +x package-cleanup-linux-x64
|
|
|
|
- name: Run package-cleanup
|
|
id: cleanup
|
|
shell: bash
|
|
env:
|
|
URL: ${{ inputs.url }}
|
|
OWNER: ${{ inputs.owner }}
|
|
TYPES: ${{ inputs.types }}
|
|
NAMES: ${{ inputs.names }}
|
|
API_TOKEN: ${{ inputs.api_token }}
|
|
DRY_RUN: ${{ inputs.dry_run }}
|
|
GITHUB_OUTPUT: ${{ env.GITHUB_OUTPUT }}
|
|
run: |
|
|
./package-cleanup-linux-x64
|
|
|