diff --git a/.github/workflows/delete.yml b/.github/workflows/delete.yml index d24e5b9..9fb3b08 100644 --- a/.github/workflows/delete.yml +++ b/.github/workflows/delete.yml @@ -8,15 +8,21 @@ on: jobs: delete: runs-on: ubuntu-latest + steps: + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + - name: Delete Docker Image from GHCR run: | docker login --username ${{ secrets.GH_USERNAME }} --password ${{ secrets.GH_TOKEN }} ghcr.io - docker image rm ghcr.io/drazzilb08/userscripts:${{ github.ref_slug }} + docker image rm ghcr.io/drazzilb08/userscripts:${{ steps.extract_branch.outputs.branch }} docker logout ghcr.io - name: Delete Docker Image from Docker run: | docker login --username ${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_TOKEN }} - docker image rm ${{ secrets.DOCKER_USERNAME }}/userscripts:${{ github.ref_slug }} + docker image rm ${{ secrets.DOCKER_USERNAME }}/userscripts:${{ steps.extract_branch.outputs.branch }} docker logout