diff --git a/docs/filter-functions.md b/docs/filter-functions.md index 65670449..dd97ff86 100644 --- a/docs/filter-functions.md +++ b/docs/filter-functions.md @@ -38,23 +38,25 @@ The following functions are supported in addition to the built-in functions prov
-| Function | Input | Args | Output | -| --------------- | ------- | ---- | ---- | -| [`allDocs`](#alldocs)
Checks the list includes only documents | [`files`](./context-variables.md#files) | - | Bool | -| [`allImages`](#allimages)
Checks the list includes only images | [`files`](./context-variables.md#files) | - | Bool | -| [`allTests`](#alltests)
Checks the list includes only tests | [`files`](./context-variables.md#files) | - | Bool | -| [`codeExperts`](#codeexperts)
Get list of contributors based on expert reviewer model results| [`repo`](./context-variables.md#repo) | `gt`, `lt` | [String] | -| [`estimatedReviewTime`](#estimatedreviewtime)
Estimated review time in minutes | [`branch`](./context-variables.md#branch)| - | Integer | -| [`extensions`](#extensions)
Lists all the unique file extensions | [String] | - | [String] | -| [`extractJitFindings`](#extractjitfindings) :fontawesome-brands-github:
Get an object with a summary of the findings found by the Jit scan | [`pr`](./context-variables.md#pr) | - | Object | -| [`extractSonarFindings`](#extractsonarfindings) :fontawesome-brands-github:
Get an object with a summary of the findings found by the SonarCloud scan | [`pr`](./context-variables.md#pr) | - | Object | -| [`explainRankByGitBlame`](#explainrankbygitblame)
Short markdown text explaining rankByGitBlame results | [`repo`](./context-variables.md#repo) | `gt`, `lt` | [String] | -| [`isFirstCommit`](#isfirstcommit)
Checks if its the author first commit in the repo | [`repo.contributors`](./context-variables.md#repo) | String | Bool | -| [`isFormattingChange`](#isformattingchange)
Checks that only formatting changed | [[`FileDiff` ](./context-variables.md#filediff-structure)] | - | Bool | -| [`mapToEnum`](#maptoenum)
return the enum value matches to the input key | String | Enum object | Object | -| [`matchDiffLines`](#matchdifflines)
Match every line in diff | [[`FileDiff` ](./context-variables.md#filediff-structure)] | `regex`, `ignoreWhiteSpaces` | [Bool] | -| [`rankByGitActivity`](#rankbygitactivity)
Get list of contributors based on `git-commit` activity | [`repo`](./context-variables.md#repo) | `gt`, `lt` | [String] | -| [`rankByGitBlame`](#rankbygitblame)
Get list of contributors based on `git-blame` results| [`repo`](./context-variables.md#repo) | `gt`, `lt` | [String] | +| Function | Input | Args | Output | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------- | ----------------------- | +| [`allDocs`](#alldocs)
Checks the list includes only documents | [`files`](./context-variables.md#files) | - | Bool | +| [`allImages`](#allimages)
Checks the list includes only images | [`files`](./context-variables.md#files) | - | Bool | +| [`allTests`](#alltests)
Checks the list includes only tests | [`files`](./context-variables.md#files) | - | Bool | +| [`codeExperts`](#codeexperts)
Get list of contributors based on expert reviewer model results | [`repo`](./context-variables.md#repo) | `gt`, `lt` | [String] | +| [`decode`](#decode)
Decode Base64 encoded string into an object | String (Base64 encoded) | - | Object | +| [`encode`](#encode)
Encode data into Base64 encoded string | Object | - | String (Base64 encoded) | +| [`estimatedReviewTime`](#estimatedreviewtime)
Estimated review time in minutes | [`branch`](./context-variables.md#branch) | - | Integer | +| [`extensions`](#extensions)
Lists all the unique file extensions | [String] | - | [String] | +| [`extractJitFindings`](#extractjitfindings) :fontawesome-brands-github:
Get an object with a summary of the findings found by the Jit scan | [`pr`](./context-variables.md#pr) | - | Object | +| [`extractSonarFindings`](#extractsonarfindings) :fontawesome-brands-github:
Get an object with a summary of the findings found by the SonarCloud scan | [`pr`](./context-variables.md#pr) | - | Object | +| [`explainRankByGitBlame`](#explainrankbygitblame)
Short markdown text explaining rankByGitBlame results | [`repo`](./context-variables.md#repo) | `gt`, `lt` | [String] | +| [`isFirstCommit`](#isfirstcommit)
Checks if its the author first commit in the repo | [`repo.contributors`](./context-variables.md#repo) | String | Bool | +| [`isFormattingChange`](#isformattingchange)
Checks that only formatting changed | [[`FileDiff` ](./context-variables.md#filediff-structure)] | - | Bool | +| [`mapToEnum`](#maptoenum)
return the enum value matches to the input key | String | Enum object | Object | +| [`matchDiffLines`](#matchdifflines)
Match every line in diff | [[`FileDiff` ](./context-variables.md#filediff-structure)] | `regex`, `ignoreWhiteSpaces` | [Bool] | +| [`rankByGitActivity`](#rankbygitactivity)
Get list of contributors based on `git-commit` activity | [`repo`](./context-variables.md#repo) | `gt`, `lt` | [String] | +| [`rankByGitBlame`](#rankbygitblame)
Get list of contributors based on `git-blame` results | [`repo`](./context-variables.md#repo) | `gt`, `lt` | [String] |
@@ -406,6 +408,38 @@ automations: reviewers: {{ repo | codeExperts(gt=10) }} ``` +#### `decode` + +Decode Base64 encoded string into an object. Encoded strings are formatted: `"base64: "` +
+ +| Argument | Usage | Type | Description | +| -------- | ------ | ------ | ------------------------------------------- | +| - | Input | String | Base64 encoded string prefixed `"Base64: "` | +| - | Output | Object | Decoded objet | + +
+ +```yaml+jinja +{{ "base64: SGVsbG8gV29ybGQ=" | decode }} # Output: "Hello World" +``` + +#### `encode` + +Encode data into Base64 encoded string. When an encoded string is passed as input for [`add-comment`](./automation-actions.md#add-comment), the action automatically detects and decodes it. +
+ +| Argument | Usage | Type | Description | +| -------- | ------ | ------------ | ----------------------------------- | +| - | Input | Object | The input object to encode | +| - | Output | String (Base64) | Base64 encoding of the object | + +
+ +```yaml+jinja +{{ "Hello World" | encode }} # Output: "base64: SGVsbG8gV29ybGQ=" +``` + #### `estimatedReviewTime` Returns the estimated review time in minutes based on statistical model.