Skip to content

fileContent

Match a repository if the content of a file in the repository matches.

Parameters

path

Path of the file in the repository. Supports globbing via filepath.Match from the Go standard library.

Name Value
Type string
Required Yes

regexp

Regular expression to match against the content of the file.

Name Value
Type string
Required Yes

Examples

# Match a repository if the file "hello-world.txt"
# contains the string "Hello".
filters:
  - filter: fileContent
    params:
      path: "hello-world.txt"
      regexp: "Hello"
# Match a repository if any JSON file
# in the root of the repository
# contains the string "Hello".
filters:
  - filter: fileContent
    params:
      path: "*.json"
      regexp: "Hello"