File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -29,15 +29,14 @@ jobs:
2929 env :
3030 OWNER : ${{ github.repository_owner }}
3131 IMAGE : deep-learning-crash-course
32+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3233 run : |
3334 echo "Fetching all versions of $OWNER/$IMAGE..."
3435 versions=$(gh api --paginate -H "Accept: application/vnd.github.v3+json" \
3536 /orgs/$OWNER/packages/container/$IMAGE/versions)
36- # find the newest by creation timestamp
3737 newest_id=$(echo "$versions" \
3838 | jq -r 'sort_by(.created_at) | reverse | .[0].id')
3939 echo "🛡 Keeping version $newest_id (most recent)"
40- # loop through all and delete those that aren't the newest
4140 echo "$versions" | jq -c '.[]' | while read ver; do
4241 id=$(echo "$ver" | jq -r '.id')
4342 if [ "$id" != "$newest_id" ]; then
4847 fi
4948 done
5049
50+
You can’t perform that action at this time.
0 commit comments