Skip to content

Commit

Permalink
Improve docs on templating
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv authored Aug 31, 2023
1 parent 3bf45cb commit c3e8a3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/config-file-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ Template values:

- `{{sourceBranch}}`: Branch the commit is coming from (usually `main`)
- `{{targetBranch}}`: Branch the backport PR will be targeting
- `{{sourcePullRequest}}`: Original pull request object (see [interface](https://github.com/sqren/backport/blob/9e42503a7d0e06e60c575ed2c3b7dc3e5df0dd5c/src/lib/sourceCommit/parseSourceCommit.ts#L23-L31))
- `{{commitMessages}}`: Message of backported commit. For multiple commits the messages will be separated by pipes (`|`).
- `{{commits}}`: A list of commits ([interface](https://github.com/sqren/backport/blob/9e42503a7d0e06e60c575ed2c3b7dc3e5df0dd5c/src/lib/sourceCommit/parseSourceCommit.ts#L15-L36))

Expand All @@ -348,7 +349,7 @@ Default: `"[{{targetBranch}}] {{commitMessages}}"`
**Example: Use original PR title prefixed by branch**

```
{{targetBranch}} {{commits.0.sourcePullRequest.title}}
{{targetBranch}} {{sourcePullRequest.title}}
```


Expand All @@ -371,7 +372,7 @@ The description uses the [handlebars templating engine](https://handlebarsjs.com
- `{{targetBranch}}`: Branch the backport PR will be targeting
- `{{commitMessages}}`: Message of backported commit. For multiple commits the messages will be separated by new lines (`|`).
- `{{defaultPrDescription}}`: The default PR description. Using this makes it easy to append and prepend text to the existing description
- `{{commits}}`: A list of commits ([interface](https://github.com/sqren/backport/blob/9e42503a7d0e06e60c575ed2c3b7dc3e5df0dd5c/src/lib/sourceCommit/parseSourceCommit.ts#L15-L36))
- `{{commits}}`: A list of commit objects (see [commit interface](https://github.com/sqren/backport/blob/9e42503a7d0e06e60c575ed2c3b7dc3e5df0dd5c/src/lib/sourceCommit/parseSourceCommit.ts#L15-L36))

**Example: List commits**

Expand Down

0 comments on commit c3e8a3d

Please sign in to comment.