Skip to content

Branch Deleted

Branch Deleted #5

Workflow file for this run

name: Branch Deleted
on: delete
env:
COMPONENT_NAME: qubership-credential-manager
TAG_NAME: ${{ github.event.ref }}
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.GITHUB_TOKEN}}
- uses: actions/delete-package-versions@v5
with:
package-name: ${{ env.COMPONENT_NAME }}
package-type: 'container'
package-version-ids: ${{ steps.get-ids-for-delete.outputs.ids-for-delete }}
if: ${{ steps.get-ids-for-delete.outputs.ids-for-delete != '' }}