Write chart_version only if latest_tag is defined (#202)
The chart_version output was written regardless of whether the latest_tag variable was defined. The latest_tag variable is only defined if skip_packaging is not set. This leads to issue #171.
Setting skip_packaging implies that an external process takes care of packaging the chart and setting the chart version. There is thus no need to write the chart_version output as it should already be known.
Closes #171
Signed-off-by: Ferdinand Hofherr mail@ferdinandhofherr.de
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
chart-releaser Action
A GitHub action to turn a GitHub project into a self-hosted Helm chart repo, using helm/chart-releaser CLI tool.
Usage
Pre-requisites
/charts, if you want to maintain your charts in a different directory, you must include acharts_dirinput in the workflow).gh-pagesto store the published charts.SourceBranchtogh-pages..ymlfile in your.github/workflowsdirectory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow fileInputs
version: The chart-releaser version to use (default: v1.7.0)config: Optional config file for chart-releaser. For more information on the config file, see the documentationcharts_dir: The charts directoryskip_packaging: This option, when populated, will skip the packaging step. This allows you to do more advanced packaging of your charts (for example, with thehelm packagecommand) before this action runs. This action will only handle the indexing and publishing steps.skip_existing: Skip package upload if release/tag already existsskip_upload: This option, when populated, will skip the upload step. This allows you to do more advanced uploading of your charts (for exemple with OCI based repositories) which doen’t require theindex.yaml.mark_as_latest: When you set this tofalse, it will mark the created GitHub release not as ‘latest’.packages_with_index: When you set this totrue, it will upload chart packages directly into publishing branch.pages_branch: Name of the branch to be used to push the index and artifacts. (default to: gh-pages but it is not set in the action it is a default value for the chart-releaser binary)Outputs
changed_charts: A comma-separated list of charts that were released on this run. Will be an empty string if no updates were detected, will be unset if--skip_packagingis used: in the latter case your custom packaging step is responsible for setting its own outputs if you need them.chart_version: The version of the most recently generated charts; will be set even if no charts have been updated since the last run.Environment variables
CR_TOKEN(required): The GitHub token of this repository (${{ secrets.GITHUB_TOKEN }})For more information on environment variables, see the documentation.
Example Workflow
Create a workflow (eg:
.github/workflows/release.yml):This uses @helm/chart-releaser-action to turn your GitHub project into a self-hosted Helm chart repo. It does this – during every push to
main– by checking each chart in your project, and whenever there’s a new chart version, creates a corresponding GitHub release named for the chart version, adds Helm chart artifacts to the release, and creates or updates anindex.yamlfile with metadata about those releases, which is then hosted on GitHub Pages. You do not need anindex.yamlfile inmainat all because it is managed in thegh-pagesbranch.Example using custom config
workflow.yml:cr.yaml:For options see config-file.
Code of conduct
Participation in the Helm community is governed by the Code of Conduct.