upload-release-asset
upload-release-asset copied to clipboard
Unexpected value for ${{ github.ref }}
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/[email protected]
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/[email protected]
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?
Yeah, how to achieve this like action/create-release properly?
@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.)