Skip to content

Branch Deleted

Branch Deleted #4

Workflow file for this run

name: Branch Deleted
on: delete
env:
COMPONENT_NAME: qubership-query-exporter
TAG_NAME: ${{ github.event.ref }}
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
jobs:
delete:
if: github.event.ref_type == 'branch'
runs-on: ubuntu-24.04
steps:
- name: Prepare Tag
run: echo "TAG_NAME=$(echo ${TAG_NAME} | sed 's@refs/heads/@@;s@/@_@g')" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${GITHUB_ACTOR}
password: ${{secrets.GITHUB_TOKEN}}
- name: Get package IDs for delete
id: get-ids-for-delete
uses: Netcracker/[email protected]
with:
component-name: ${{ env.COMPONENT_NAME }}
component-tag: ${{ env.TAG_NAME }}
access-token: ${{ secrets.GH_ACCESS_TOKEN }}
- uses: actions/delete-package-versions@v5
with:
package-name: ${{ env.COMPONENT_NAME }}
package-type: 'container'
package-version-ids: ${{ env.IDS_FOR_DELETE }}
if: ${{ env.IDS_FOR_DELETE != '' }}