Trampoline-CX/action-turbo-changed

BUG: Github Action Failing on Turborepo v 1.12.0

Closed this issue ยท 3 comments

๐Ÿ› Bug Description / How to Reproduce

Currenty running the action like this:

    - name: App changed in last commit?
      id: changedAction
      uses: Trampoline-CX/action-turbo-changed@v1
      with:
        workspace: ${{ inputs.app-name }}
        from: HEAD^1

Error from GH Actions: SyntaxError: Unexpected token A in JSON at position 1

Issue likely lies in the turborepo output that now contains the following text followed by the json

Attention:
Turborepo now collects completely anonymous telemetry regarding usage.
This information is used to shape the Turborepo roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://turbo.build/repo/docs/telemetry

{... start of json}

Probably requires a change in main.ts

debug(Output from Turborepo: ${json})

const parsedOutput = JSON.parse(json)
const changed = parsedOutput.packages.includes(workspace)

โœ… Expected behavior

Gh action to run successfully

fixed by setting

env:
  TURBO_TELEMETRY_MESSAGE_DISABLED: 1

In the gh action env

This is now fixed on version 1.1 of the action ๐Ÿš€ Thanks for the insights on the environment variable to use!

The fix has been backported to the v1 version, so your Github Action Workflows should now just work without having to upgrade this action nor having to manually set the environment variable.