Release assets not appearing

Hi,

I have a Github action setup to create a release and upload binaries to it, however I am experiencing some odd behaviour. If I view the release on the following URL I do not see any assets apart from the source code:

https://github.com/andymantell/govuk-frontend-diff/releases/tag/v0.1-alpha-4

This is the URL that I can reach by clicking through the releases section in the Github UI. However, when the action has run I also receive an email from github saying that a new release has been created at:

https://github.com/andymantell/govuk-frontend-diff/releases/tag/refs/tags/v0.1-alpha-4

This one has all the artifacts that I am expecting to see.

As far as I can see, they are one and the same release. But they appear to have different URLs (One has an additional refs/tags section in it.

I don’t quite understand what’s going on here. Can anyone shed any light on this?

Thanks,

Andy

Hi @andymantell,

Glad to see you in Github Community Forum!
To add assets to an existing release, please use ‘edit’ instead of ‘create’ for command ‘hub release’.
Option ‘create’ will create a GitHub release for the specified TAG name. If git tag TAG does not exist, it will be created at TARGET (default: current branch).
Please fix code as below:

      - name: Attach binaries to release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          set -x
          assets=()
          for asset in ./bin/*; do
            assets+=("-a" "$asset")
          done
          githubref=${{ github.ref }}   # get the github.ref value
          hub release edit "${assets[@]}" -m "${githubref##*/}" "${githubref##*/}"   # specify tag name not the github.ref here.

It works on my side. Please check my workflow here.

Thanks

Thanks @weide-zhou! I have made the changes you suggest and it’s now working perfectly.

Thankyou very much for the quick response, very much appreciated.