changesets/action

problem with outputs object

ah7255703 opened this issue · 3 comments

i am trying to upload the build directory (dist) as artifact
NOTE: it is only one package.

      - name: Upload embed as artifact.
        uses: actions/upload-artifact@v3
        if: ${{ steps.changesets.outputs.published }}
        with:
          name: my-package@${{steps.changesets.outputs.publishedPackages[0].version}}
          path: search-widget/dist

the result is my-package@

I also have this issue. I have tried with:

  • id: changesets: same issue with or without id in the step
  • tried the name with quotes " ... ${{ ... }} "
  • tried the name without quotes ... ${{ ... }}

the issue is still there

You have to run changesets publish instead of your own publish script in order for the output to be set

I'm running into the same issue even though my release script calls npm build-package && changeset publish.
I get outputs.published as 'true' but the outputs.publishedPackages stays empty

edit:

The problem is that outputs.publishedPackages is a plain string.
It works as expected when wrapping the string in a GH action function that converts it to JSON:
fromJson(outputs.publishedPackages)