Compare commits
4 Commits
2026.02.15
...
2026.02.15
| Author | SHA1 | Date | |
|---|---|---|---|
| ff8cd3350b | |||
| 7e4abe9efd | |||
| 706d9f89f0 | |||
| a2e4152d5e |
@@ -29,7 +29,13 @@ runs:
|
|||||||
- name: Download and test package-cleanup tool
|
- name: Download and test package-cleanup tool
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
curl -OJ https://git.sh-edraft.de/api/packages/sh-edraft.de/generic/package-cleanup/package-cleanup-linux-x64
|
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
|
# Make executable
|
||||||
chmod +x package-cleanup-linux-x64
|
chmod +x package-cleanup-linux-x64
|
||||||
@@ -46,9 +52,5 @@ runs:
|
|||||||
DRY_RUN: ${{ inputs.dry_run }}
|
DRY_RUN: ${{ inputs.dry_run }}
|
||||||
GITHUB_OUTPUT: ${{ env.GITHUB_OUTPUT }}
|
GITHUB_OUTPUT: ${{ env.GITHUB_OUTPUT }}
|
||||||
run: |
|
run: |
|
||||||
echo "Starting cleanup..."
|
|
||||||
./package-cleanup-linux-x64
|
./package-cleanup-linux-x64
|
||||||
echo "Cleanup completed."
|
|
||||||
sleep 10000000
|
|
||||||
rm package-cleanup-linux-x64
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ public class Worker(
|
|||||||
if (dryRun)
|
if (dryRun)
|
||||||
{
|
{
|
||||||
logger.LogInformation("Dry run enabled, not deleting {Count} packages", packages.Count);
|
logger.LogInformation("Dry run enabled, not deleting {Count} packages", packages.Count);
|
||||||
|
logger.LogInformation("Would delete packages: {versions}",
|
||||||
|
string.Join(", ", packages.Select(p => p.Version)));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var giteaPackage in packages)
|
foreach (var giteaPackage in packages)
|
||||||
@@ -66,7 +68,7 @@ public class Worker(
|
|||||||
logger.LogInformation("Found {Count} packages to delete for name '{Name}'", packagesToDelete.Count,
|
logger.LogInformation("Found {Count} packages to delete for name '{Name}'", packagesToDelete.Count,
|
||||||
name);
|
name);
|
||||||
|
|
||||||
// await DeletePackages(packagesToDelete, cancellationToken);
|
await DeletePackages(packagesToDelete, cancellationToken);
|
||||||
logger.LogInformation("Deleted {Count} packages for name '{Name}'", packagesToDelete.Count, name);
|
logger.LogInformation("Deleted {Count} packages for name '{Name}'", packagesToDelete.Count, name);
|
||||||
|
|
||||||
logger.LogInformation("Cleanup finished for name '{Name}'", name);
|
logger.LogInformation("Cleanup finished for name '{Name}'", name);
|
||||||
|
|||||||
Reference in New Issue
Block a user