aaddrick--claude-desktop-debian
3e076d4dd9
Deploy Worker / deploy (push) Failing after 1s
Shellcheck / Check shell scripts (push) Failing after 1s
CI / Build Packages (amd64 - appimage) (push) Has been skipped
CI / Build Packages (amd64 - deb) (push) Has been skipped
CI / Build Packages (amd64 - rpm) (push) Has been skipped
CI / Build Packages (arm64 - appimage) (push) Has been skipped
CI / Build Packages (arm64 - deb) (push) Has been skipped
CI / Test Flags Parsing (push) Failing after 1s
BATS Tests / BATS unit tests (push) Failing after 1s
CI / Build Packages (arm64 - rpm) (push) Has been skipped
CI / Test Build Artifacts (amd64) (push) Has been skipped
CI / Test Build Artifacts (arm64) (push) Has been skipped
CI / Update APT Repository (push) Has been cancelled
CI / Mirror Official .deb to Release (push) Has been cancelled
CI / Update DNF Repository (push) Has been cancelled
CI / Update AUR Package (push) Has been cancelled
CI / Create Release (push) Has been cancelled
55 行
1.7 KiB
YAML
55 行
1.7 KiB
YAML
name: Cleanup Workflow Runs
|
|
run-name: |
|
|
Cleanup: ${{
|
|
github.event_name == 'schedule' && 'Weekly scheduled cleanup' ||
|
|
format('Manual cleanup by @{0}', github.actor)
|
|
}}
|
|
|
|
on:
|
|
schedule:
|
|
# Run every Thursday at midnight UTC
|
|
- cron: "0 0 * * 4"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
cleanup:
|
|
name: Delete Non-Release Runs
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
actions: write
|
|
|
|
steps:
|
|
- name: Delete old workflow runs not tied to release tags
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
GH_REPO: ${{ github.repository }}
|
|
run: |
|
|
echo "Fetching workflow runs..."
|
|
|
|
# Calculate cutoff date (3 days ago)
|
|
cutoff=$(date -u -d '3 days ago' '+%Y-%m-%dT%H:%M:%SZ')
|
|
echo "Deleting non-release runs older than: $cutoff"
|
|
|
|
# Get all runs where:
|
|
# - headBranch doesn't start with "v" (not a release tag)
|
|
# - createdAt is older than 3 days
|
|
runs_to_delete=$(gh run list --json databaseId,headBranch,createdAt --limit 1000 | \
|
|
jq -r --arg cutoff "$cutoff" \
|
|
'.[] | select((.headBranch | startswith("v") | not) and (.createdAt < $cutoff)) | .databaseId')
|
|
|
|
if [ -z "$runs_to_delete" ]; then
|
|
echo "No old non-release runs to delete."
|
|
exit 0
|
|
fi
|
|
|
|
count=$(echo "$runs_to_delete" | wc -l)
|
|
echo "Found $count runs to delete..."
|
|
|
|
# Delete each run
|
|
echo "$runs_to_delete" | while read -r run_id; do
|
|
echo "Deleting run $run_id..."
|
|
gh run delete "$run_id" || echo "Failed to delete run $run_id (may already be deleted)"
|
|
done
|
|
|
|
echo "Cleanup complete!"
|