Skip to content

Commit 37661cc

Browse files
committed
Sign chart with cosign
Signed-off-by: Matheus Pimenta <[email protected]>
1 parent 3832a76 commit 37661cc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/release.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
with:
1818
fetch-depth: 0
1919

20+
- name: Setup Cosign
21+
uses: sigstore/[email protected]
22+
2023
- name: Configure Git
2124
run: |
2225
git config user.name "$GITHUB_ACTOR"
@@ -42,12 +45,15 @@ jobs:
4245
username: ${{ github.actor }}
4346
password: ${{ secrets.GITHUB_TOKEN }}
4447

45-
- name: Push Charts to GHCR
48+
- name: Push Charts to GHCR and Sign
4649
run: |
4750
shopt -s nullglob
4851
for pkg in .cr-release-packages/*; do
4952
if [ -z "${pkg:-}" ]; then
5053
break
5154
fi
52-
helm push "${pkg}" oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts
55+
chart_name=$(echo "${pkg##*/}" | sed 's/\.tgz$//' | sed 's/-[0-9].*$//')
56+
repo="oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts"
57+
helm push "${pkg}" "${repo}" |& grep Digest: | awk '{print $NF}' > digest.txt
58+
cosign sign --yes "${repo}/${chart_name}@$(cat digest.txt)"
5359
done

0 commit comments

Comments
 (0)