name: 'Helm: Chart Release' # DISCLAIMER: This workflow is not maintained by the Prowler team. Refer to contrib/k8s/helm/prowler-app for the source code. on: release: types: - 'published' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: false env: CHART_PATH: contrib/k8s/helm/prowler-app permissions: {} jobs: release-helm-chart: if: github.repository == 'prowler-cloud/prowler' runs-on: ubuntu-latest timeout-minutes: 10 permissions: contents: read packages: write steps: - name: Harden the runner (Audit all outbound calls) uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 with: egress-policy: audit - name: Checkout repository uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Set up Helm uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1 - name: Set appVersion from release tag run: | RELEASE_TAG="${GITHUB_EVENT_RELEASE_TAG_NAME}" echo "Setting appVersion to ${RELEASE_TAG}" sed -i "s/^appVersion:.*/appVersion: \"${RELEASE_TAG}\"/" ${{ env.CHART_PATH }}/Chart.yaml env: GITHUB_EVENT_RELEASE_TAG_NAME: ${{ github.event.release.tag_name }} - name: Login to GHCR run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${GITHUB_ACTOR} --password-stdin - name: Update chart dependencies run: helm dependency update ${{ env.CHART_PATH }} - name: Package Helm chart run: helm package ${{ env.CHART_PATH }} --destination .helm-packages - name: Push chart to GHCR run: | PACKAGE=$(ls .helm-packages/*.tgz) helm push "$PACKAGE" oci://ghcr.io/${{ github.repository_owner }}/charts