Skip to content

Commit fae385d

Browse files
committed
fix: update Kaniko workflow to install git and correct secret reference for authentication
1 parent 5e37987 commit fae385d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/build-kaniko-docker.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,19 @@ jobs:
3434
packages: write # push to GHCR
3535

3636
steps:
37+
# ------------------------------------------------------------------
38+
# 0 Install git in Kaniko container
39+
# ------------------------------------------------------------------
40+
- name: Install git
41+
run: |
42+
apt-get update && apt-get install -y git
43+
3744
# ------------------------------------------------------------------
3845
# 1 Clone the repository with plain git (no Node, no checkout action)
3946
# ------------------------------------------------------------------
4047
- name: Clone repository
4148
env:
42-
PAT: ${{ secrets.GHCR_PAT }} # PAT with write:packages (+repo if private)
49+
PAT: ${{ secrets.CR_PAT }} # PAT with write:packages (+repo if private)
4350
run: |
4451
git config --global url."https://${{ github.actor }}:${PAT}@github.com/".insteadOf "https://github.com/"
4552
git clone --depth 1 \
@@ -55,7 +62,7 @@ jobs:
5562
# ------------------------------------------------------------------
5663
- name: Write /kaniko/.docker/config.json
5764
env:
58-
PAT: ${{ secrets.GHCR_PAT }}
65+
PAT: ${{ secrets.CR_PAT }}
5966
run: |
6067
mkdir -p /kaniko/.docker
6168
echo '{"auths":{"ghcr.io":{"auth":"'"$(echo -n '${{ github.actor }}:${PAT}' | base64 -w0)"'"}}}' \

0 commit comments

Comments
 (0)