Skip to content

Commit

Permalink
- add README updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepenz authored Jun 4, 2023
1 parent 831ac3e commit 1f64818
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ This configuration is a `JSON` in the following format. (The below showcases *ex
"on_property": "title",
"method": "match"
},
"reference": {
"pattern": ".*\\ \\#(.).*",
"on_property": "body",
"method": "replace",
"target": "$1"
},
"transformers": [
{
"pattern": "[\\-\\*] (\\[(...|TEST|CI|SKIP)\\])( )?(.+?)\n(.+?[\\-\\*] )(.+)",
Expand Down Expand Up @@ -371,8 +377,10 @@ When using `*` values are joined by `,`.
| `${{REVIEWERS[*]}}` | GitHub Login names of specified reviewers. Requires `fetchReviewers` to be enabled. |
| `${{APPROVERS[*]}}` | GitHub Login names of users who approved the PR. |

Additionally there is a special array placeholder `REVIEWS` which allows access to it's properties:
`(KEY)[(*/index)].(property)` for example: `REVIEWS[*].author` or `REVIEWS[*].body`
Additionally there are special array placeholders like `REVIEWS` which allows access to it's properties via
`(KEY)[(*/index)].(property)`.

For example: `REVIEWS[*].author` or `REVIEWS[*].body`

| **Placeholder** | **Description** |
|-------------------------------|--------------------------------------------|
Expand All @@ -382,6 +390,14 @@ Additionally there is a special array placeholder `REVIEWS` which allows access
| `${{REVIEWS[*].submittedAt}}` | The date whent he review was submitted. |
| `${{REVIEWS[*].state}}` | The state of the given review. |

Similar to `REVIEWS`, `REFERENCED` PRs also offer special placeholders.

| **Placeholder** | **Description** |
|-------------------------------|---------------------------------------------------------------------------|
| `${{REFERENCED[*].number}}` | The PR number of the referenced PR. |
| `${{REFERENCED[*].title}}` | The title of the referenced PR. |
| `${{REFERENCED[*]."..."}}` | Allows to use most other PR properties as placeholder. |

</p>
</details>

Expand Down Expand Up @@ -448,6 +464,7 @@ Table of descriptions for the `configuration.json` options to configure the resu
| label_extractor.flags | Defines the regex flags specified for the pattern. Default: `gu`. |
| label_extractor.on_empty | Defines the placeholder to be filled in, if the regex does not lead to a result. |
| duplicate_filter | Defines the `Extractor` to use for retrieving the identifier for a PR. In case of duplicates will keep the last matching pull request (depends on `sort`). See `label_extractor` for details on `Extractor` properties. |
| reference | Defines the `Extractor` to use for resolving the "PR-number" for a parent PR. In case of a match, the child PR will not be included in the release notes. See `label_extractor` for details on `Extractor` properties. |
| transformers | An array of `transform` specifications, offering a flexible API to modify the text per pull request. This is applied on the change text created with `pr_template`. `transformers` are executed per change, in the order specified |
| transformer.pattern | A `regex` pattern, extracting values of the change message. |
| transformer.target | The result pattern, the regex groups will be filled into. Allows for full transformation of a pull request message. Including potentially specified texts |
Expand Down
2 changes: 1 addition & 1 deletion __tests__/transform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ it('Reference PRs', async () => {
]
customConfig.pr_template = "${{NUMBER}} -- ${{REFERENCED[*].number}}"
customConfig.reference = {
pattern: '.*\ \#(.).*',
pattern: '.*\ \#(.).*', // matches the 1 from "abcdefg #1 adfasdf"
on_property: 'body',
method: 'replace',
target: '$1'
Expand Down

0 comments on commit 1f64818

Please # to comment.