Skip to content

Output doesn't match the documentation #528

Description

@tsteuwer-accesso

I'm running the following in a github action:

- name: Publish Packages
        id: changesets
        continue-on-error: true
        uses: changesets/action@v1
        with:
          publish: pnpm release
          createGithubReleases: ${{ inputs.runPublishToGithub }}

My package.json has a script called release that simply does turbo build && changesets publish.

In the next step after the above, I'm trying to find out if a specific package was published using:

echo "published=${{contains(steps.changesets.outputs.publishedPackages.*.name, '@myorg/my-package')}}" >> $GITHUB_OUTPUT

However, it always returns false. When I actually run echo "Changesets published outputs: ${{toJson(steps.changesets.outputs)}}", it responds with:

Changesets published outputs: {
  published: true,
  publishedPackages: ["name":"@myorg/my-package"],
  hasChangesets: false
} Changesets published outputs: {
  published: true,
  publishedPackages: ["version":"1.0.9"],
  hasChangesets: false
}

Full step:

- name: Build Storybook for UDS Icons
        id: my_package_data
        run: |
          echo "Changesets published outputs: ${{toJson(steps.changesets.outputs)}}"
          echo "published=${{contains(steps.changesets.outputs.publishedPackages.*.name, '@myorg/my-package')}}" >> $GITHUB_OUTPUT
          echo "version=$(echo "$(jq -r '.version' ./packages/my-package/package.json)" | cut -d '.' -f 1)" >> $GITHUB_OUTPUT

The documentation states that it should be this:

Changedsets published outputs: {
   published: true,
   publishedPackages: [{ "name": "@myorg/my-package", "version": "1.0.9"}],
   hasChangesets: false,
}

Why are version and name coming out in separate objects?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions