Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

${{ toJson(github) }} results in error when there is bracket anwhere in the github context. #3361

Open
PramodKumarYadav opened this issue Jun 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@PramodKumarYadav
Copy link

PramodKumarYadav commented Jun 26, 2024

Describe the bug
The toJson(github) command to print github context fails if the commit message (or anywhere else - say a repository description) contains brackets ().

To Reproduce
Steps to reproduce the behavior:

  1. Update your test repository description with a text that includes brackets. Example: My test repository with brackets (to test failing github context).
    image
  2. Print the github context using echo statements such as below.
name: 🎯 Trigger tests

on:
  workflow_dispatch:

jobs:
  log-requester-details:
    runs-on: ubuntu-latest
    steps:
      - name: Log Requester details
        run: |
          echo "Event details: ${{ toJson(github) }}"

Expected behaviour
Should print the log.

Actual behaviour
Throws error on line that contains brackets. In this example it was in the description of repository but a more common scenario is to get this failure in commit message.

image

image

NOTE: The line number is also always one ahead of what is printed in the logs.

@PramodKumarYadav PramodKumarYadav added the bug Something isn't working label Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant