diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index bfcdf82..9797c51 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - main + - 'release/*' types: [ closed ] defaults: @@ -16,4 +17,10 @@ jobs: steps: - run: | export PR_BRANCH_TAG=$(echo ${GITHUB_HEAD_REF#refs/heads/} | tr '/' '-') - curl -uucentral:${{ secrets.DOCKER_REGISTRY_PASSWORD }} -X DELETE "https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral/owrrm/$PR_BRANCH_TAG" + + if [[ ! $PR_BRANCH_TAG =~ (main|master|release-*) ]]; then + echo "PR branch is $PR_BRANCH_TAG, deleting Docker image" + curl -s -uucentral:${{ secrets.DOCKER_REGISTRY_PASSWORD }} -X DELETE "https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral/owrrm/$PR_BRANCH_TAG" + else + echo "PR branch is $PR_BRANCH_TAG, not deleting Docker image" + fi