chart-releaser-action icon indicating copy to clipboard operation
chart-releaser-action copied to clipboard

Unable to release using tags

Open aabouzaid opened this issue 4 years ago • 1 comments

I'd like to release charts based on custom git tags (e.g. v1.0.0) but looks like the only supported method by chart-releaser-action is a release from a branch.

Let's assume we have a main branch, when I create a tag out of it, I get this in the chart-releaser-action step:

Looking up latest tag...
Discovering changed charts since 'v1.0.0'...
Nothing to do. No chart changes detected.

That's because, in cr.sh script, it checks the tag on the commit, and since the latest tag is actually the latest, it shows no changes.

Maybe providing an option to ignore a list of tags could be a good solution.

Please note, this is not only about using tags to release but also in case a tag is pushed to the repo it will miss up the whole release process.

aabouzaid avatar Nov 08 '20 15:11 aabouzaid

Hello!

We are having the exact same issue, 1 year later :D Is this something that is going to be fixed?

We have a workaround directly in the workflow but it would be nice to be able to use the releaser-action to make releases on tags.

This is our workarround:


      - name: Chart releaser
        run: |
          # Download chart releaser
          curl -sSLo cr.tar.gz "https://github.com/helm/chart-releaser/releases/download/v1.2.1/chart-releaser_1.2.1_linux_amd64.tar.gz"
          tar -xzf cr.tar.gz
          rm -f cr.tar.gz
          repo=$(cut -d '/' -f 2 <<< "$GITHUB_REPOSITORY")
          owner=$(cut -d '/' -f 1 <<< "$GITHUB_REPOSITORY")
          exists=$(curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/{{repo_name}}$repo/releases/tags/$repo-${{ steps.fix_tag.outputs.tag }} -w %{http_code} -o /dev/null)
          if [[ $exists != "200" ]]; then
            echo "Creating release..."
            # package chart
            ./cr package ${{ inputs.chart_path }}/$repo
            # upload chart to github releases
            ./cr upload \
                --owner "$owner" \
                --git-repo "$repo" \
                --token "${{ secrets.GITHUB_TOKEN }}"
            # Update index and push to github pages
            ./cr index \
                --owner "$owner" \
                --git-repo "$repo" \
                --token "${{ secrets.GITHUB_TOKEN }}" \
                --charts-repo ${{ inputs.chart_url }} \
                --push
          else
            echo "Release already exists"
          fi

alejandrogr avatar Dec 01 '21 15:12 alejandrogr

fixed in https://github.com/helm/chart-releaser-action/pull/96

cpanato avatar Mar 24 '23 11:03 cpanato