Skip to content

Commit

Permalink
Delete branch tag on merge (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
rob93c authored Oct 15, 2023
2 parents 9fa2d7b + 8cdb0ff commit 378ded0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
rob93c/christmas-greeter
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/master' }}
type=ref,event=pr
- name: Upload Docker image
Expand All @@ -43,3 +43,10 @@ jobs:
tags: ${{ steps.metadata.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Delete Docker tag
if: github.event.pull_request.merged
run: |
tag_to_delete="pr-${{github.event.issue.number}}"
docker rmi rob93c/christmas-greeter:$tag_to_delete
echo "The tag $tag_to_delete has been deleted"

0 comments on commit 378ded0

Please sign in to comment.