diff --git a/.github/workflows/push-to-docker.yml b/.github/workflows/push-to-docker.yml index 103d716..27dc502 100644 --- a/.github/workflows/push-to-docker.yml +++ b/.github/workflows/push-to-docker.yml @@ -17,6 +17,11 @@ jobs: - name: Checkout uses: actions/checkout@v3 + with: + fetch-depth: 0 + - + name: Fetch all tags + run: git fetch --force --tags - name: Set up Go uses: actions/setup-go@v3 @@ -40,13 +45,18 @@ jobs: name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v2 + - + name: Check snapshot + if: "!startsWith(github.ref, 'refs/tags/')" + id: snapshot + run: echo '::set-output name=ARG::--snapshot' - name: Run GoReleaser uses: goreleaser/goreleaser-action@v3 with: distribution: goreleaser version: latest - args: build --rm-dist + args: build --rm-dist ${{ steps.snapshot.outputs.ARG }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - @@ -73,4 +83,4 @@ jobs: context: . push: ${{ github.event_name != 'pull_request' }} platforms: linux/amd64,linux/arm64 - tags: ${{ steps.meta.outputs.tags }} \ No newline at end of file + tags: ${{ steps.meta.outputs.tags }}