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:
29
29
env :
30
30
OWNER : ${{ github.repository_owner }}
31
31
IMAGE : deep-learning-crash-course
32
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
32
33
run : |
33
34
echo "Fetching all versions of $OWNER/$IMAGE..."
34
35
versions=$(gh api --paginate -H "Accept: application/vnd.github.v3+json" \
35
36
/orgs/$OWNER/packages/container/$IMAGE/versions)
36
- # find the newest by creation timestamp
37
37
newest_id=$(echo "$versions" \
38
38
| jq -r 'sort_by(.created_at) | reverse | .[0].id')
39
39
echo "🛡 Keeping version $newest_id (most recent)"
40
- # loop through all and delete those that aren't the newest
41
40
echo "$versions" | jq -c '.[]' | while read ver; do
42
41
id=$(echo "$ver" | jq -r '.id')
43
42
if [ "$id" != "$newest_id" ]; then
48
47
fi
49
48
done
50
49
50
+
You can’t perform that action at this time.
0 commit comments