-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cr.sh: line 109: latest_tag: unbound variable #171
Comments
Steps to create an empty branch:
|
Reverts #43 This action is not currently working. Same bug as helm/chart-releaser-action#171
Just ran into this too when upgrading from v1.5 to v1.6. The code only sets the latest_tag variable when skip_packaging is false, but it still attempts to read the variable when skip_packaging is true: if [[ -z "$skip_packaging" ]]; then
echo 'Looking up latest tag...'
local latest_tag
latest_tag=$(lookup_latest_tag)
...
else
install_chart_releaser
rm -rf .cr-index
mkdir -p .cr-index
release_charts
update_index
fi
echo "chart_version=${latest_tag}" >chart_version.txt Looks like the bug was introduced in #130 by @n-oden. Hopefully a simple fix? |
This error might have two causes, no tags in repo and skip_packaging set to false -- I'm still getting it in the latter scenario even with tags present. |
…ons/develop/helm/chart-releaser-action-1.6.0" Bug helm/chart-releaser-action#171. This reverts commit e99c326, reversing changes made to 009810c.
@korenyoni thanks for taking a look, but lookup_latest_tag isn't even called in my scenario's code path (skip_packaging = false). Take a look at this code added in #130 (abridged to make the bug more obvious): if [[ -z "$skip_packaging" ]]; then
echo 'Looking up latest tag...'
local latest_tag
latest_tag=$(lookup_latest_tag)
...
fi
echo "chart_version=${latest_tag}" >chart_version.txt See how latest_tag is declared a local variable and then is accessed outside of its scope. If this was C# the compiler would throw an error :p. |
helm/chart-releaser-action#171 Signed-off-by: Akshath Kothari <[email protected]>
Also facing this. Is there a workaround? |
demote chart releaser due to helm/chart-releaser-action#171
@davidkarlsen I see you seem to be a maintainer of this repo. Sorry to bother you, but would you be able to take a look at this? Quite a few of us have had to downgrade back to v1.5 due to this bug. I'd love to use some of the new functionality from 1.6 but currently can't. If you have time to review/merge PRs but not create them, let us know and maybe we can contribute a fix for this regression. I see 9 open PRs so I'm hesitant to spend time on that myself without knowing someone would look at it. |
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 helm#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 helm#171
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 helm#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 helm#171 Signed-off-by: Ferdinand Hofherr <[email protected]>
seems like everything works fine, it just fails right at the end. Would be nice to get this fixed though. |
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 helm#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 helm#171 Signed-off-by: Ferdinand Hofherr <[email protected]>
cr.sh will fail if there are no tags in the repository.
Steps to recreate:
git checkout --orphan gh-pages
) and push to repoI am using the latest version of the action (main branch).
The text was updated successfully, but these errors were encountered: