Skip to content

Commit 2e2011c

Browse files
committed
fix github workflows so that registry name is lowercase
Signed-off-by: Satyam Bhardwaj <[email protected]>
1 parent 5049891 commit 2e2011c

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

.github/workflows/docker-build.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,19 @@ jobs:
2727
- name: Log in to Container Registry
2828
uses: docker/login-action@v3
2929
with:
30-
registry: ${{ env.REGISTRY }}
30+
registry: ghcr.io
3131
username: ${{ github.actor }}
3232
password: ${{ secrets.GITHUB_TOKEN }}
3333

34+
- name: Set lowercased image name
35+
shell: bash
36+
run: echo "IMAGE_NAME_LC=${GITHUB_REPOSITORY@L}" >> "$GITHUB_ENV"
37+
3438
- name: Extract metadata
3539
id: meta
3640
uses: docker/metadata-action@v5
3741
with:
38-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
42+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LC }}
3943
tags: |
4044
type=ref,event=branch
4145
type=semver,pattern={{version}}

.github/workflows/helm-package.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
permissions:
1818
contents: write
1919
packages: write
20-
20+
2121
steps:
2222
- name: Checkout repository
2323
uses: actions/checkout@v4
@@ -27,6 +27,10 @@ jobs:
2727
with:
2828
version: v3.14.0
2929

30+
- name: Set lowercased owner
31+
shell: bash
32+
run: echo "OWNER_LC=${GITHUB_REPOSITORY_OWNER@L}" >> "$GITHUB_ENV"
33+
3034
- name: Determine version
3135
id: version
3236
run: |
@@ -46,25 +50,25 @@ jobs:
4650
run: |
4751
VERSION=${{ steps.version.outputs.version }}
4852
echo "Updating charts to version: $VERSION"
49-
53+
5054
# Update helm-standalone chart
5155
sed -i "s/version: .*/version: $VERSION/" deployments/helm-standalone/Chart.yaml
5256
sed -i "s/appVersion: .*/appVersion: \"$VERSION\"/" deployments/helm-standalone/Chart.yaml
53-
54-
# Update helm-for-kof chart
57+
58+
# Update helm-for-kof chart
5559
sed -i "s/version: .*/version: $VERSION/" deployments/helm-for-kof/Chart.yaml
5660
sed -i "s/appVersion: .*/appVersion: \"$VERSION\"/" deployments/helm-for-kof/Chart.yaml
5761
5862
- name: Package Helm Charts
5963
run: |
6064
mkdir -p charts
61-
65+
6266
# Package helm-standalone
6367
helm package deployments/helm-standalone -d charts
64-
68+
6569
# Package helm-for-kof
6670
helm package deployments/helm-for-kof -d charts
67-
71+
6872
ls -la charts/
6973
7074
- name: Login to GitHub Container Registry
@@ -77,21 +81,21 @@ jobs:
7781
- name: Push Charts to GHCR
7882
run: |
7983
VERSION=${{ steps.version.outputs.version }}
80-
84+
8185
# Push helm-standalone chart
82-
helm push charts/finops-agent-$VERSION.tgz oci://ghcr.io/${{ github.repository_owner }}/charts
83-
86+
helm push charts/finops-agent-$VERSION.tgz oci://ghcr.io/${{ env.OWNER_LC }}/charts
87+
8488
# Push helm-for-kof chart
85-
helm push charts/finops-agent-kof-$VERSION.tgz oci://ghcr.io/${{ github.repository_owner }}/charts
89+
helm push charts/finops-agent-kof-$VERSION.tgz oci://ghcr.io/${{ env.OWNER_LC }}/charts
8690
8791
- name: Install ORAS
8892
uses: oras-project/setup-oras@v1
8993

9094
- name: Tag charts as latest
9195
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
9296
run: |
93-
oras tag ghcr.io/${{ github.repository_owner }}/charts/finops-agent:${{ steps.version.outputs.version }} latest
94-
oras tag ghcr.io/${{ github.repository_owner }}/charts/finops-agent-kof:${{ steps.version.outputs.version }} latest
97+
oras tag ghcr.io/${{ env.OWNER_LC }}/charts/finops-agent:${{ steps.version.outputs.version }} latest
98+
oras tag ghcr.io/${{ env.OWNER_LC }}/charts/finops-agent-kof:${{ steps.version.outputs.version }} latest
9599
96100
- name: Create GitHub Release
97101
if: startsWith(github.ref, 'refs/tags/')

0 commit comments

Comments
 (0)