Skip to content

'toJson' is not defined #115

@Nuru

Description

@Nuru

One example job in the GitHub Actions documentation uses toJson and it works when run on GitHub, but not when run by act.

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Dump GitHub context
        env:
          GITHUB_CONTEXT: ${{ toJson(github) }}
        run: echo "$GITHUB_CONTEXT"

runs fine on GitHub, but act complains:

[test/test] ⭐  Run Dump GitHub context
ERRO[0001] Unable to interpolate string '${{ toJson(github) }}' - [ReferenceError: 'toJson' is not defined] 
| ${{ toJson(github) }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/workflowRelating to workflow definitionskind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions