Skip to content

Commit 24426ab

Browse files
authored
[universal] use lowercase repository name for ghcr push (CloudPirates-io#192)
use lowercase repository name for ghcr push
1 parent 096725e commit 24426ab

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/release.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ jobs:
4848
uses: sigstore/[email protected]
4949
if: ${{ steps.chart-releaser.outputs.changed_charts }}
5050

51+
- id: github-repo-owner-name
52+
uses: ASzc/change-string-case-action@v6
53+
with:
54+
string: ${{ github.repository_owner }}
55+
5156
- name: Upload charts to OCI registries
5257
id: upload
5358
if: ${{ steps.chart-releaser.outputs.changed_charts }}
@@ -91,12 +96,12 @@ jobs:
9196
fi
9297
9398
# Push to GHCR
94-
echo "Pushing Helm chart $CHART_NAME-$CHART_VERSION.tgz to oci://ghcr.io/${{ github.repository_owner }}/helm-charts"
95-
if helm push ${{ github.workspace }}/.cr-release-packages/${CHART_NAME}-${CHART_VERSION}.tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts 2>&1 | tee ${CHART_NAME}-ghcr-output.log; then
99+
echo "Pushing Helm chart $CHART_NAME-$CHART_VERSION.tgz to oci://ghcr.io/${{ steps.github-repo-owner-name.outputs.lowercase }}/helm-charts"
100+
if helm push ${{ github.workspace }}/.cr-release-packages/${CHART_NAME}-${CHART_VERSION}.tgz oci://ghcr.io/${{ steps.github-repo-owner-name.outputs.lowercase }}/helm-charts 2>&1 | tee ${CHART_NAME}-ghcr-output.log; then
96101
97102
# Extract digest and sign GHCR chart
98103
GHCR_DIGEST=$(cat ${CHART_NAME}-ghcr-output.log | awk -F '[, ]+' '/Digest/{print $NF}')
99-
cosign sign -y --key env://COSIGN_KEY ghcr.io/${{ github.repository_owner }}/helm-charts/${CHART_NAME}:${CHART_VERSION}@$GHCR_DIGEST
104+
cosign sign -y --key env://COSIGN_KEY ghcr.io/${{ steps.github-repo-owner-name.outputs.lowercase }}/helm-charts/${CHART_NAME}:${CHART_VERSION}@$GHCR_DIGEST
100105
101106
echo "Successfully released $CHART_NAME-$CHART_VERSION to GHCR"
102107
else

0 commit comments

Comments
 (0)