File tree Expand file tree Collapse file tree 3 files changed +39
-12
lines changed
Expand file tree Collapse file tree 3 files changed +39
-12
lines changed Original file line number Diff line number Diff line change @@ -126,14 +126,16 @@ Allows to build helm chart and push it to remote container repository.
126126This action relies on git tags to be present in order to generate an artifact tag.
127127
128128# ## Inputs
129- | Name | Description | Optional | Default value |
130- |----------------------------|:-----------------------------------------------|----------|---------------|
131- | container_registry_address | Container registry address | False | |
132- | application : | Application name | False | |
133- | container_registry_user | Container registry username | False | |
134- | container_registry_token | Container registry access token | False | |
135- | helm_version | Version of helm to install | True | 3.9.2 |
136- | helm_directory | Location of helm chart related to project root | True | .helm |
129+ | Name | Description | Optional | Default value |
130+ |----------------------------|:-----------------------------------------------------------------------------------|----------|---------------|
131+ | container_registry_address | Container registry address | False | |
132+ | application : | Application name | False | |
133+ | container_registry_user | Container registry username | False | |
134+ | container_registry_token | Container registry access token | False | |
135+ | helm_version | Version of helm to install | True | 3.9.2 |
136+ | helm_directory | Location of helm chart related to project root | True | .helm |
137+ | app_version | Application version to use for the chart. If omitted, the latest tag will be used. | True | |
138+ | chart_version | Chart version to use for the chart. If omitted, the latest tag will be used. | True | |
137139
138140# ## Outputs
139141No outputs defined
Original file line number Diff line number Diff line change @@ -32,6 +32,16 @@ inputs:
3232 required : false
3333 default : ' .helm'
3434
35+ app_version :
36+ description : Application version to use for the chart. If omitted, the latest tag will be used.
37+ required : false
38+ default : ' '
39+
40+ chart_version :
41+ description : Chart version to use for the chart. If omitted, the latest tag will be used.
42+ required : false
43+ default : ' '
44+
3545runs :
3646 using : " composite"
3747 steps :
4555 REPO_LOGIN : ${{ inputs.container_registry_user }}
4656 REPO_TOKEN : ${{ inputs.container_registry_token }}
4757 APPLICATION : ${{ inputs.application }}
58+ APP_VERSION : ${{ inputs.app_version }}
59+ CHART_VERSION : ${{ inputs.chart_version }}
4860 shell : bash
Original file line number Diff line number Diff line change 1616
1717set -Eeuo pipefail
1818
19- appVersion=$( git describe --tags --abbrev=7)
20- sed -i " s/appVersion: 0.0.0/appVersion: \" ${appVersion: 1} \" /" Chart.yaml
21- sed -i " s/^version: .*/version: \" $appVersion \" /" Chart.yaml
19+
20+ if [[ -z " $APP_VERSION " ]]; then
21+ appVersion=$( git describe --tags --abbrev=7)
22+ else
23+ appVersion=" $APP_VERSION "
24+ fi ;
25+
26+ if [[ -z " $CHART_VERSION " ]]; then
27+ chartVersion=$( git describe --tags --abbrev=7)
28+ else
29+ chartVersion=" $CHART_VERSION "
30+ fi ;
31+
32+
33+ sed -i " s/appVersion: 0.0.0/appVersion: \" $appVersion \" /" Chart.yaml
34+ sed -i " s/^version: .*/version: \" $chartVersion \" /" Chart.yaml
2235
2336helm package .
2437echo " $REPO_TOKEN " | helm registry login " $REPO_ADDRESS " --username " $REPO_LOGIN " --password-stdin
2538echo " oci://$REPO_ADDRESS /helm/"
26- helm push " $APPLICATION -$appVersion .tgz" " oci://$REPO_ADDRESS /helm/"
39+ helm push " $APPLICATION -$chartVersion .tgz" " oci://$REPO_ADDRESS /helm/"
You can’t perform that action at this time.
0 commit comments