Skip to content

build(deps): Bump k8s.io/apiextensions-apiserver from 0.25.4 to 0.26.3 #433

build(deps): Bump k8s.io/apiextensions-apiserver from 0.25.4 to 0.26.3

build(deps): Bump k8s.io/apiextensions-apiserver from 0.25.4 to 0.26.3 #433

name: Clean up images from PR testing
on:
pull_request:
types: closed
jobs:
cleanup-images:
name: quay-image-cleanup
runs-on: ubuntu-20.04
steps:
- name: Delete PR-related images
env:
QUAY_OAUTH_TOKEN: ${{ secrets.QUAY_OAUTH_TOKEN }}
DEV_REPOSITORY: "https://quay.io/api/v1/repository/maistra-dev"
TAG: "pr-${{ github.event.number }}"
HEAD_REF: "${{ github.event.pull_request.head.ref }}"
run: |
HEADER_TOKEN="Authorization: Bearer ${QUAY_OAUTH_TOKEN}"
## We create images for PRs on Prow and Circle, but Circle also runs builds when there's a branch only,
## thus we might need to clean-up images tagged after the branch
declare -a tags=("${TAG}-prow" "${TAG}-circle" "${HEAD_REF##*/}")
for t in "${tags[@]}"
do
curl -H "${HEADER_TOKEN}" -X DELETE ${DEV_REPOSITORY}/istio-workspace/tag/${t} || true
curl -H "${HEADER_TOKEN}" -X DELETE ${DEV_REPOSITORY}/istio-workspace-operator-bundle/tag/${t} || true
curl -H "${HEADER_TOKEN}" -X DELETE ${DEV_REPOSITORY}/istio-workspace-test/tag/${t} || true
curl -H "${HEADER_TOKEN}" -X DELETE ${DEV_REPOSITORY}/istio-workspace-test-prepared-image-prepared/tag/${t} || true
curl -H "${HEADER_TOKEN}" -X DELETE ${DEV_REPOSITORY}/istio-workspace-test-prepared-prepared-image/tag/${t} || true
done
shell: bash