mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-10-29 09:42:38 +00:00
27 lines
714 B
YAML
27 lines
714 B
YAML
name: Clean up PR Docker images
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- 'release/*'
|
|
types: [ closed ]
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
jobs:
|
|
cleanup:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: |
|
|
export PR_BRANCH_TAG=$(echo ${GITHUB_HEAD_REF#refs/heads/} | tr '/' '-')
|
|
|
|
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/owprov/$PR_BRANCH_TAG"
|
|
else
|
|
echo "PR branch is $PR_BRANCH_TAG, not deleting Docker image"
|
|
fi
|