Skip to content

Commit 51890ea

Browse files
committed
Address feedback
1 parent 09578bc commit 51890ea

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/deleteOldReleases.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ name: Delete Old Releases
33
on:
44
schedule:
55
- cron: '0 10 * * *' # Daily at 10:00 UTC which is 2:00 AM PST (UTC-8)
6-
workflow_dispatch: # Manual trigger
7-
push:
6+
workflow_dispatch:
7+
push:
8+
branches:
9+
- main
810

911
jobs:
10-
clean_releases:
12+
delete_release_assets:
1113
runs-on: ubuntu-latest
1214
steps:
13-
- name: Delete old releases
15+
- name: Delete old release assets
1416
# To use GitHub CLI in a GitHub Actions workflow, set the GH_TOKEN environment variable
1517
env:
1618
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -19,12 +21,12 @@ jobs:
1921
run: |
2022
2123
# Define 60 days in seconds (60 * 24 * 60 * 60 = 5184000)
22-
SECONDS_60_DAYS=5184000
24+
60_DAYS_IN_SECONDS=5184000
2325
2426
# Store the list of asset ID and Name pairs in the variable
2527
# "ASSET_ID ASSET_NAME" on each line
2628
ASSETS_TO_DELETE=$(gh api --paginate repos/${{ github.repository }}/releases | \
27-
jq -r --argjson cutoff_seconds "$SECONDS_60_DAYS" '
29+
jq -r --argjson cutoff_seconds "$60_DAYS_IN_SECONDS" '
2830
# Calculate the 60-day cutoff as now minus 60 days
2931
. as $releases | (now - $cutoff_seconds) as $cutoff |
3032

0 commit comments

Comments
 (0)