Skip to content

Commit

Permalink
fix: improve artifact deletion script logging
Browse files Browse the repository at this point in the history
Improve clarity of deletion log by adjusting message format and adding RPMID details to output. Add error handling to continue on failure.
  • Loading branch information
esolitos authored and gitbutler-client committed Nov 25, 2024
1 parent a8b1f84 commit 873137e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/scripts/delete-old-cloudsmith-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@ done

echo
if [[ "${GITHUB_EVENT_NAME}" == "schedule" || "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
printf '\033[1;33mDeleting the following RPMs:\033[0m\n\n' "${RPMS_TO_DELETE}"
printf '\033[1;33mDeleting RPMs packages:\033[0m\n\n'

while IFS= read -r RPMID
do
printf '\033[0;33m- %s\033[0m\n' "${RPMID}"
curl --silent --show-error --location --fail \
--request DELETE \
--header "X-Api-Key: ${CLOUDSMITH_API_TOKEN}" \
--header "accept: application/json" \
"https://api.cloudsmith.io/v1/packages/vespa/open-source-rpms/${RPMID}/"
"https://api.cloudsmith.io/v1/packages/vespa/open-source-rpms/${RPMID}/" || true # Continue on error
done < "${RPMS_TO_DELETE}"
else
printf '\033[1;32m#### Dry-run mode ####\033[0m\n'
Expand Down

0 comments on commit 873137e

Please sign in to comment.