action-gh-release icon indicating copy to clipboard operation
action-gh-release copied to clipboard

Issue with outputs.assets

Open toroConverter opened this issue 2 years ago • 6 comments

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?

toroConverter avatar Mar 21 '22 20:03 toroConverter

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

alxjrvs avatar May 05 '22 05:05 alxjrvs

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.

alxjrvs avatar May 05 '22 05:05 alxjrvs

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 avatar May 05 '22 05:05 alxjrvs

@alxjrvs you can probably reference a specific commit hash

strazto avatar Jun 04 '22 07:06 strazto

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

nkcr avatar Jul 15 '22 06:07 nkcr

Diff: https://github.com/softprops/action-gh-release/compare/cd28b0f5ee8571b76cfdaa62a30d51d752317477...v1

piotrplenik avatar Jun 09 '23 08:06 piotrplenik