Skip to content

Commit

Permalink
docs: update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-evans committed Apr 9, 2021
1 parent 2867447 commit 548adff
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- [Filtering push events](#filtering-push-events)
- [Dynamic configuration using variables](#dynamic-configuration-using-variables)
- [Setting the pull request body from a file](#setting-the-pull-request-body-from-a-file)
- [Using a markdown template](#using-a-markdown-template)
- [Debugging GitHub Actions](#debugging-github-actions)


Expand Down Expand Up @@ -560,6 +561,31 @@ The content must be [escaped to preserve newlines](https://github.saobby.my.eu.orgmunity/t/se
body: ${{ steps.get-pr-body.outputs.body }}
```
### Using a markdown template
In this example, a markdown template file is added to the repository at `.github/pull-request-template.md` with the following content.
```
This is a test pull request template
Render template variables such as {{ .foo }} and {{ .bar }}.
```
The template is rendered using the [render-template](https://github.com/chuhlomin/render-template) action and the result is used to create the pull request.
```yml
- name: Render template
id: template
uses: chuhlomin/render-template@v1.2
with:
template: .github/pull-request-template.md
vars: |
foo: this
bar: that
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
body: ${{ steps.template.outputs.result }}
```
### Debugging GitHub Actions
#### Runner Diagnostic Logging
Expand Down

0 comments on commit 548adff

Please sign in to comment.