trying to prevent deletion of all tags if less than 10 are present
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -49,8 +49,13 @@ jobs:
|
||||
run: |
|
||||
TAGS="$(curl -s -u "${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_PASS }}" https://${{ secrets.REGISTRY_PATH }}/v2/umbrella/tags/list | jq -r ".tags[]")"
|
||||
COUNT=$(echo "$TAGS" | wc -l)
|
||||
if [ $COUNT -gt 10 ]; then
|
||||
REMAIN=$((COUNT - 10))
|
||||
echo "$TAGS" | head -n $REMAIN > /tmp/old_tags
|
||||
else
|
||||
echo "less than 10 tags, skipping cleanup
|
||||
echo "" > /tmp/old_tags
|
||||
fi
|
||||
|
||||
- name: Remove tags
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user