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

fix: Prevent error when using quotation marks in BuildMessage #75

Merged
merged 3 commits into from
Jul 17, 2024

Commits on Jun 27, 2024

  1. fix: Prevent error when using quotation marks in BuildMessage

    When a PR title or commit summary contains quotation marks, they were
    not escaped when injected into the JSON attachment. This caused
    a message like
    
        unable to unmarshal webhook message: invalid character 't' after object key:value pair
    
    when used inside of a template containing this test:
    
    ```json
    {
      "text": "*Status*: FAILURE\n*Repo*: {{ .RepositoryName }} | *Branch*: {{ .BuildBranch }} | *Author*: {{ .BuildAuthor }}\n*Build*: {{ .BuildLink }}\n*Message*: {{ .BuildMessage }}"
    }
    ```
    
    This change safens this use case. Other typical fields _shouldn't_ have
    quotation marks in them, but it might be prudent down the line to
    cleanse _all_ fields as they are injected into the JSON or provide
    a method usable inside of the template that escapes correctly.
    colindean committed Jun 27, 2024
    Configuration menu
    Copy the full SHA
    6ba463e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e6a55fd View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2024

  1. Configuration menu
    Copy the full SHA
    17816a0 View commit details
    Browse the repository at this point in the history