Skip to content

chore(deps): update sigstore/cosign-installer action to v4.1.1 (#1905) #188

chore(deps): update sigstore/cosign-installer action to v4.1.1 (#1905)

chore(deps): update sigstore/cosign-installer action to v4.1.1 (#1905) #188

Workflow file for this run

name: Package Helm Chart and publish to GitHub Packages
on:
push:
tags:
- "helm-chart-*.*.*"
paths:
- 'charts/**'
permissions:
contents: write
packages: write
env:
REGISTRY: ghcr.io
jobs:
helm-release:
runs-on: [ ubuntu-latest ]
strategy:
fail-fast: false
matrix:
include:
- chartDir: charts/greenhouse
chartName: greenhouse
- chartDir: charts/ui
chartName: greenhouse-ui
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Set up Helm
uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
with:
version: "v3.19.2"
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3.14
check-latest: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # v47.0.5
with:
files: |
${{ matrix.chartDir }}/**
- name: Check if Helm chart with same version already exists
id: check-chart
if: steps.changed-files.outputs.all_changed_files != ''
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
# List all changed
echo "All changed files: $ALL_CHANGED_FILES"
chartName=$(yq .name "${{ matrix.chartDir }}/Chart.yaml")
chartVersion=$(yq .version "${{ matrix.chartDir }}/Chart.yaml")
echo "chart_version=${chartVersion}" >> "$GITHUB_OUTPUT"
if $(helm pull "oci://${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.chartDir }}" --version $chartVersion); then
echo "bump=true" >> "$GITHUB_OUTPUT"
fi
- name: Chart needs version bump
if: steps.check-chart.outputs.bump == 'true'
env:
CHART_VERSION: ${{ steps.check-chart.outputs.chart_version }}
run: |
echo "Chart ${{ matrix.chartDir }}:${{ env.CHART_VERSION }} already exists in OCI registry. Skipping upload. Please increment the chart version."
exit 1
- name: Push Charts to GHCR
if: steps.changed-files.outputs.all_changed_files != '' && steps.check-chart.outputs.bump != 'true'
run: |
helm dependency update ${{ matrix.chartDir }}
helm package ${{ matrix.chartDir }} -d ${{ matrix.chartDir }}
PKG_NAME=`ls ${{ matrix.chartDir }}/*.tgz`
helm push ${PKG_NAME} oci://${{ env.REGISTRY }}/${{ github.repository }}/charts/