action-gh-release
action-gh-release copied to clipboard
Issue with outputs.assets
Hi everyone, I'm running this simple workflow to understand well how this action works:
name: Test
on:
workflow_dispatch:
jobs:
build:
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: echo ${{ github.sha }} > Release.txt
- name: Test
run: cat Release.txt
- name: Release
id: release
uses: softprops/action-gh-release@v1
with:
files: Release.txt
tag_name: ${{ github.ref_name }}
- run: |
echo ${{ steps.release.outputs.url }}
echo ${{ steps.release.outputs.id }}
echo ${{ steps.release.outputs.upload_url }}
echo ${{ steps.release.outputs.assets }}
windows-2019 is a constraint of my future application,
This workflow creates the new release and print all the outputs except steps.release.outputs.assets
.
Any idea on why?
I was also noticing this. I was trying to use an asset that I had uploaded, but .assets
is returning null.
run: echo ${{ toJson(steps.release.outputs.assets) }}
would result in a line like this: echo null
This may be because the assets
work is not part of the latest bundled release (Neither is append_body
, which also doesn't work in the action right now), but I do not know for certain if that is what is happening here.
Using uses: softprops/action-gh-release@HEAD
seems to work, though this comes with all the normal concerns about pulling dependencies directly from the development branch!
@alxjrvs you can probably reference a specific commit hash
Just had the same issue, and it took me a while to realize the JSON parsing error was coming from that:
The template is not valid. .github/workflows/deploy.yml (Line: 58, Col: 12): Error reading JToken from JsonReader. Path '', line 0, position 0.
As mentioned, using the latest or a commit hash solved it:
- name: Release
id: release_pub
# at this time of writing, the latest version does not contain the assets
# output
uses: softprops/action-gh-release@cd28b0f5ee8571b76cfdaa62a30d51d752317477
Diff: https://github.com/softprops/action-gh-release/compare/cd28b0f5ee8571b76cfdaa62a30d51d752317477...v1