Skip to content

Commit

Permalink
Correct PR image tags SHA
Browse files Browse the repository at this point in the history
Currently the SHA - based on the action - seems to not be aware of the branch.
So it always uses the head SHA of the default branch.
This change ensures it uses the SHA of the PR at the time it's built.
  • Loading branch information
mallardduck committed Dec 10, 2024
1 parent 0ecd192 commit 66ede08
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pr-debug-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
echo "Fetching details for PR #$pr_number"
pr_response=$(gh api repos/${{ github.repository }}/pulls/$pr_number)
head_sha=$(echo "$pr_response" | jq -r '.head.sha')
echo "::set-output name=head_sha::$head_sha"
echo "head_sha=$head_sha" >> $GITHUB_OUTPUT
- name: Checkout PR Head
uses: actions/checkout@v3
with:
Expand All @@ -60,7 +60,7 @@ jobs:
with:
images: ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}/helm-locker
tags: |
type=sha,prefix=pr-${{ github.event.inputs.pr_number }}-
type=raw,prefix=pr-${{ github.event.inputs.pr_number }}-${{ steps.get_head_sha.outputs.head_sha }}
type=raw,value=pr-${{ github.event.inputs.pr_number }}
- name: Build and push helm-locker image
id: push
Expand All @@ -78,7 +78,7 @@ jobs:
with:
images: ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}/helm-project-operator
tags: |
type=sha,prefix=pr-${{ github.event.inputs.pr_number }}-
type=raw,prefix=pr-${{ github.event.inputs.pr_number }}-${{ steps.get_head_sha.outputs.head_sha }}
type=raw,value=pr-${{ github.event.inputs.pr_number }}
- name: Build Helm-Project-Operator image
uses: docker/build-push-action@v5
Expand All @@ -95,7 +95,7 @@ jobs:
with:
images: ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,prefix=pr-${{ github.event.inputs.pr_number }}-
type=raw,prefix=pr-${{ github.event.inputs.pr_number }}-${{ steps.get_head_sha.outputs.head_sha }}
type=raw,value=pr-${{ github.event.inputs.pr_number }}
- name: Build Prometheus Federator image
uses: docker/build-push-action@v5
Expand Down

0 comments on commit 66ede08

Please sign in to comment.