Skip to content

Commit 8517fa6

Browse files
committed
Document pull_request_payload parameter in README
1 parent c6e7be4 commit 8517fa6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ jobs:
7575
pr_number: ${{ github.event.pull_request.number }}
7676
pr_title: ${{ github.event.pull_request.title }}
7777
pr_source: ${{ github.event.pull_request.head.label }}
78+
# Or simply provide the raw Pull Request payload in JSON format
79+
pull_request_payload: ${{ toJson(github.event.pull_request) }}
7880
```
7981
8082
### Command specification
@@ -97,11 +99,16 @@ jobs:
9799
| pr_number | Pull Request number | no¹ |
98100
| pr_title | Title of the Pull Request | no¹ |
99101
| pr_source | Source branch for the Pull Request | no¹ |
102+
| pull_request_payload | PR payload in JSON format² | no³ |
100103

101104
1) The Action will determine whether to send an embed tailored towards a Pull Request Check Run or towards a general workflow run based on the presence of non-null values for the four pull request arguments. This means that you either have to provide **all** of them or **none** of them.
102105

103106
Do note that you can typically keep the arguments in the argument list even if your workflow is triggered for non-PR events, as GitHub's object notation (`name.name.name`) will silently return `null` if a name is unset. In the workflow example above, a `push` event would send an embed tailored to a general workflow run, as all the PR-related arguments would all be `null`.
104107

108+
2) The pull request payload may be nested within an array, `[{...}]`. If the array contains multiple PR payloads, only the first one will be picked.
109+
110+
3) Providing a JSON payload will take precedence over the individual pr arguments. If a JSON payload is present, it will be used and the individual pr arguments will be ignored, unless parsing the JSON fails.
111+
105112
## Recipes
106113

107114
To be added.

0 commit comments

Comments
 (0)