Module: GitHub::Actions Private

Extended by:
T::Sig
Defined in:
brew/Library/Homebrew/utils/github/actions.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Helper functions for interacting with GitHub Actions.

Defined Under Namespace

Classes: Annotation

Class Method Summary collapse

Class Method Details

.escape(string) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

Returns:



14
15
16
17
18
19
# File 'brew/Library/Homebrew/utils/github/actions.rb', line 14

def self.escape(string)
  # See https://github.community/t/set-output-truncates-multiline-strings/16852/3.
  string.gsub("%", "%25")
        .gsub("\n", "%0A")
        .gsub("\r", "%0D")
end