mergeable icon indicating copy to clipboard operation
mergeable copied to clipboard

Bug Report: Validator "contents" returns error

Open soheilina opened this issue 2 years ago • 1 comments

The following code returns error:

version: 2
mergeable:
  - when: pull_request.opened, pull_request.reopened
    name: test
    validate:
      - do: contents
        files:
          pr_diff: true
        must_exclude:
          regex: 'Submodule'
          message: 'some message'
    pass:
      - do: comment
        payload:
          body: >
            Passed!
    fail:
      - do: comment
        payload:
          body: >
            Failed!
    error:
      - do: comment
        payload:
          body: >
            An error has occurred!

This is the other file in the PR that is expected to be caught by contents and returns fail: image

This is the result on GitHub, while it was expected that "Failed!" is returned: image

Does anybody know why do I get an error here? How can I get more information about the error?

soheilina avatar Jan 18 '23 13:01 soheilina

UPDATE:

image

This error message in text format:

TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
    at Function.from (buffer.js:313:9)
    at Function.getContent (/app/lib/github/api.js:113:21)
    at async Contents.validate (/app/lib/validators/contents.js:62:23)
    at async Promise.all (index 0)
    at async processWorkflow (/app/lib/flex/lib/processWorkflow.js:104:20)
    at async executeMergeable (/app/lib/flex/flex.js:40:3)
    at async /app/lib/mergeable.js:102:7
    at async Promise.all (index 0)

soheilina avatar Jan 27 '23 14:01 soheilina