actions / upload-release-asset

An Action to upload a release asset via the GitHub Release API
MIT License
687 stars 189 forks source link

Unexpected value for ${{ github.ref }} #36

Open timbod7 opened 4 years ago

timbod7 commented 4 years ago

I've using this action for the first time here:

https://github.com/timbod7/adl/blob/master/.github/workflows/release.yaml

I'm specifying an upload asset_path like: adl-bindist-${{ github.ref }}-osx.zip:

    - name: Upload macOS build
      uses: actions/upload-release-asset@v1.0.1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        upload_url: ${{ steps.create_release.outputs.upload_url }}
        asset_path: dist-macOS/adl-bindist.zip
        asset_name: adl-bindist-${{ github.ref }}-osx.zip
        asset_content_type: application/zip

but this is not expanding as I expected. With a tag of v0.13 I expected an asset name of adl-bindist-v0.13-osx.zip, but instead see adl-bindist-refs.tags.v0.13-osx.zip. This is inconsistent with other rules in the same workflow, eg:

    - name: Create Release
      id: create_release
      uses: actions/create-release@v1.0.0
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        tag_name: ${{ github.ref }}
        release_name: Release ${{ github.ref }}
        draft: false
        prerelease: false

where release_name expands to "Release v0.13".

Is this behaviour expected?

el7cosmos commented 4 years ago

Yeah, how to achieve this like action/create-release properly?

JostMigenda commented 3 years ago

@el7cosmos If you still need this, see the discussion at https://github.community/t/how-to-get-just-the-tag-name/16241 for a solution. (That’s also what OP has implemented.)