Skip to content

Commit 9848c55

Browse files
authored
feat(publish-helm-chart): Add publish and sign toggle (#99)
1 parent e6d0618 commit 9848c55

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

publish-helm-chart/README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@ It needs the `id-token: write` permission to be able to sign the Helm chart with
1212
1313
### Inputs
1414

15-
| Input | Required | Description |
16-
| ------------------------- | -------- | --------------------------------------------------------------- |
17-
| `chart-registry-uri` | Yes | The URI of the Helm Chart registry |
18-
| `chart-registry-username` | Yes | The username used to login to the Helm Chart registry |
19-
| `chart-registry-password` | Yes | The password used to login to the Helm Chart registry |
20-
| `chart-repository` | Yes | Path to the Helm chart, for example `sdp-charts/kafka-operator` |
21-
| `chart-directory` | Yes | The directory where the Chart.yaml file is located |
22-
| `chart-version` | Yes | The Helm Chart version |
23-
| `app-version` | Yes | The app version to set in the Helm Chart |
24-
| `helm-version` | No | The version of helm |
15+
| Input | Required | Description |
16+
| ------------------------- | -------- | ----------------------------------------------------------------- |
17+
| `chart-registry-uri` | Yes | The URI of the Helm Chart registry |
18+
| `chart-registry-username` | Yes | The username used to login to the Helm Chart registry |
19+
| `chart-registry-password` | Yes | The password used to login to the Helm Chart registry |
20+
| `chart-repository` | Yes | Path to the Helm chart, for example `sdp-charts/kafka-operator` |
21+
| `chart-directory` | Yes | The directory where the Chart.yaml file is located |
22+
| `chart-version` | Yes | The Helm Chart version |
23+
| `app-version` | Yes | The app version to set in the Helm Chart |
24+
| `helm-version` | No | The version of helm |
25+
| `publish-and-sign` | No | Whether to publish and sign the Helm Chart. `"true"` or `"false"` |
2526

2627
### Outputs
2728

publish-helm-chart/action.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ inputs:
3636
SUFFIX may be 's' for seconds (the default), 'm' for minutes, 'h' for hours or 'd' for days.
3737
See `sleep --help` for the full details.
3838
default: "30s"
39+
publish-and-sign:
40+
description: Whether to publish and sign the packaged Helm Chart. Can be "true" or "false"
41+
default: "true"
3942
runs:
4043
using: composite
4144
steps:
@@ -51,6 +54,7 @@ runs:
5154
run: "$GITHUB_ACTION_PATH/../.scripts/actions/install_helm.sh"
5255

5356
- name: Log into Container Registry (${{ inputs.chart-registry-uri }}) using Helm
57+
if: inputs.publish-and-sign == 'true'
5458
env:
5559
CHART_REGISTRY_USERNAME: ${{ inputs.chart-registry-username }}
5660
CHART_REGISTRY_PASSWORD: ${{ inputs.chart-registry-password }}
@@ -64,6 +68,7 @@ runs:
6468
helm registry login --username "$CHART_REGISTRY_USERNAME" --password "$CHART_REGISTRY_PASSWORD" "$CHART_REGISTRY_URI"
6569
6670
- name: Log into Container Registry (${{ inputs.chart-registry-uri }}) using Docker
71+
if: inputs.publish-and-sign == 'true'
6772
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
6873
with:
6974
registry: ${{ inputs.chart-registry-uri }}
@@ -97,6 +102,7 @@ runs:
97102
"$CHART_DIRECTORY"
98103
99104
- name: Publish Helm Chart
105+
if: inputs.publish-and-sign == 'true'
100106
env:
101107
CHART_REGISTRY_URI: ${{ inputs.chart-registry-uri }}
102108
CHART_REPOSITORY: ${{ inputs.chart-repository }}
@@ -128,6 +134,7 @@ runs:
128134
echo "CHART_DIGEST=$CHART_DIGEST" | tee -a "$GITHUB_ENV"
129135
130136
- name: Sign Helm Chart
137+
if: inputs.publish-and-sign == 'true'
131138
env:
132139
RETRY_TIMEOUT: ${{ inputs.cosign-retry-timeout }}
133140
RETRY_COUNT: ${{ inputs.cosign-retries }}

0 commit comments

Comments
 (0)