Giter Site home page Giter Site logo

Comments (3)

peter-evans avatar peter-evans commented on June 30, 2024 1

What you are doing is basically the same as this snippet. You're just writing %0A for newlines in place of \n, which is what the snippet is doing, too.

As for why the snippet didn't work, my guess is that the original string in bash had literal \n strings in it, not real newline characters. I'm not a bash expert so I'm not 100% sure, though.

Glad you got it working anyway. 👍

from create-or-update-comment.

peter-evans avatar peter-evans commented on June 30, 2024

Hi @janpio

Glad to hear you found this action useful.

What did work, was just directly use %0A instead of \n

Do you mean that you used %0A directly in the source file? A snippet of your workflow showing what didn't/did work would be helpful to understand.

from create-or-update-comment.

janpio avatar janpio commented on June 30, 2024

Oh yeah, that was not worded very clearly.

Here is the actual PR and code: https://github.com/prisma/docs/pull/1569/files#diff-36f0236ca349b31dde3a9edf30873225fe9806cd6f3e5bc90e38657669270479R19-R41 Further down the file this body output is used in your action.

So I am constructing a body string via some (terrible) bash code, basically an intro, then a list of things via a loop and an outro. I first has normal line breaks in my bash code so body was multi line when output there, but the end result in the comment always has \n no matter what I tried, including your code snippet that should replace the characters. So I ended up just directly using %0A when crafting my body string (see code I linked to) and that worked.

from create-or-update-comment.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.