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

Escape Quotes in fields #21

Open
dkershner6 opened this issue Jul 7, 2022 · 2 comments
Open

Escape Quotes in fields #21

dkershner6 opened this issue Jul 7, 2022 · 2 comments

Comments

@dkershner6
Copy link

The action breaks without having JSON unfriendly characters escaped, and GitHub actions doesn't have a way to do this to the input (but C# does!).

Can the inputs please be escaped before sending?

@maikschneider
Copy link

Yes, this is a really annoying issue. Are there any plans to fix this?

@maikschneider
Copy link

Ah, there was a simple solution: Just escape the input via toJSON() function. The returned value is in quotes, so you need to remove them in the schema, e.g.:

    steps:
      - uses: aliencube/microsoft-teams-actions@v0.8.0
        with:
          title: 'New comment on issue #${{ github.event.issue.number }}: "${{ github.event.issue.title }}"'
          sections: '[{ "activityText": ${{ toJSON(github.event.comment.body) }}  }]'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants