encode_string | R Documentation |
Encodes a multiline string into one line for GitHub Action output.
encode_string(string, join = FALSE)
string |
A character vector. |
join |
Join vector into single string using encoded newline. |
This will only encode '%', '\n', '\r' as these will be automatically
decoded by GitHub when using the output via ${{ steps.<step_id>.outputs.<name> }}
. You can use utils::URLencode()
instead
of this function to also escape everything else problematic like (double)
quotes etc. but you will have to manually use utils::URLdecode()
to revert
this.
A character vector (of length 1 if join
).
chrs <- c("100% This is some output with \n", "a new line")
encode_string(chrs)
# encode some md (e.g. to post as comment)
md <- c("# Important PR Comment", " ", "This commit is great!")
encode_string(md, TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.