Skip to content

Commit 1c29d00

Browse files
committed
Use git reference for checkout by default.
1 parent f2894eb commit 1c29d00

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/docker.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Checkout repository
2626
uses: actions/checkout@v4
2727
with:
28-
ref: ${{ inputs.commit || 'main' }}
28+
ref: ${{ github.ref || inputs.commit || 'main' }}
2929

3030
- name: Log in to Docker Hub
3131
uses: docker/login-action@v3
@@ -57,6 +57,10 @@ jobs:
5757
uses: docker/metadata-action@v5
5858
with:
5959
images: ${{ steps.image-names.outputs.images }}
60+
# Don't set latest label if it is a prerelease.
61+
tags: |
62+
type=raw,value=${{ github.ref_name }}
63+
${{ github.event_name == 'release' && github.event.release.prerelease != true && 'type=raw,value=latest' || '' }}
6064
6165
- name: Build and push Docker image
6266
uses: docker/build-push-action@v5

0 commit comments

Comments
 (0)