Skip to content

Commit

Permalink
use tag rather than commit sha
Browse files Browse the repository at this point in the history
  • Loading branch information
sgress454 committed Feb 4, 2025
1 parent 33b481f commit 28b2b06
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/goreleaser-fleet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,19 @@ jobs:
with:
subject-path: "dist/**"

# Get the commit hash so we can get image digests
- name: Get the short commit hash
id: commit
run: echo "short_commit=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: Get tag
run: |
echo "TAG=$(git describe --tags | sed -e "s/^fleet-//")" >> $GITHUB_OUTPUT
id: docker

# Get the image digests from the goreleaser artifacts
# Adapted from https://github.com/goreleaser/goreleaser/issues/4852#issuecomment-2122790132
- name: Get image digests
continue-on-error: true
id: image_digests
run: |
echo "digest_fleet=$(cat ./dist/artifacts.json | jq -r '.[]|select(.type == "Published Docker Image" and (.name | contains("fleetdm/fleet:${{ steps.commit.outputs.short_commit }}"))) | select(. != null)|.extra.Digest')" >> "$GITHUB_OUTPUT"
echo "digest_fleetctl=$(cat ./dist/artifacts.json | jq -r '.[]|select(.type == "Published Docker Image" and (.name | contains("fleetdm/fleetctl:${{ steps.commit.outputs.short_commit }}"))) | select(. != null)|.extra.Digest')" >> "$GITHUB_OUTPUT"
echo "digest_fleet=$(cat ./dist/artifacts.json | jq -r '.[]|select(.type == "Published Docker Image" and (.name | contains("fleetdm/fleet:${{ steps.docker.outputs.tag }}"))) | select(. != null)|.extra.Digest')" >> "$GITHUB_OUTPUT"
echo "digest_fleetctl=$(cat ./dist/artifacts.json | jq -r '.[]|select(.type == "Published Docker Image" and (.name | contains("fleetdm/fleetctl:${{ steps.docker.outputs.tag }}"))) | select(. != null)|.extra.Digest')" >> "$GITHUB_OUTPUT"
- name: Attest Fleet image
uses: actions/attest-build-provenance@619dbb2e03e0189af0c55118e7d3c5e129e99726 # v2.0
Expand All @@ -125,11 +125,6 @@ jobs:
subject-name: "fleetdm/fleetctl"
push-to-registry: true

- name: Get tag
run: |
echo "TAG=$(git describe --tags | sed -e "s/^fleet-//")" >> $GITHUB_OUTPUT
id: docker

- name: List tags for push
run: |
echo "The following TAGs are to be pushed: ${{ steps.docker.outputs.TAG }}"
Expand Down

0 comments on commit 28b2b06

Please sign in to comment.