You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Note:** The example step above contains the typical way of providing the arguments.
72
+
**Note:** The default values assume that the workflow you want to report the status of is also the workflow that is running this action. If this is not possible (e.g., because you don't have access to secrets in a `pull_request`-triggered workflow), you could use a `workflow_run` triggered workflow that reports the status of the workflow that triggered it. See the recipes section below for an example.
85
73
86
-
| Argument | Description | Required |
74
+
| Argument | Description | Default |
87
75
| --- | --- | :---: |
88
-
| webhook_id | ID of the Discord webhook (use a string) | yes |
89
-
| webhook_token | Token of the Discord webhook | yes |
90
-
| workflow_name | Name of the workflow | yes |
91
-
| run_id | Run ID of the workflow | yes |
92
-
| run_number | Run number of the workflow | yes |
93
-
| status | Status for the embed; one of ["succes", "failure", "cancelled"] | yes |
94
-
| actor | Actor who requested the workflow | yes |
95
-
| repository | Repository; has to be in form `owner/repo` | yes |
96
-
| ref | Branch or tag ref that triggered the workflow run | yes |
97
-
| sha | Full commit SHA that triggered the workflow run. | yes |
98
-
| pr_author_login | **Login** of the Pull Request author | no¹ |
99
-
| pr_number | Pull Request number | no¹ |
100
-
| pr_title | Title of the Pull Request | no¹ |
101
-
| pr_source | Source branch for the Pull Request | no¹ |
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.
107
95
@@ -113,4 +101,111 @@ jobs:
113
101
114
102
## Recipes
115
103
116
-
To be added.
104
+
### Reporting the status of a `pull_request`-triggered workflow
105
+
106
+
One complication with `pull_request`-triggered workflows is that your secrets won't be available if the workflow is triggered for a pull request made from a fork. As you'd typically provide the webhook token as a secret, this makes using this action in such a workflow slightly more complicated.
107
+
108
+
However, GitHub has provided an additional workflow trigger specifically for this situation: [`workflow_run`](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_run). You can use this event to start a workflow whenever another workflow is being run or has just finished. As workflows triggered by `workflow_run` always run in the base repository, it has full access to your secrets.
109
+
110
+
To give your `workflow_run`-triggered workflow access to all the information we need to build a Pull Request status embed, you'll need to share some details from the original workflow in some way. One way to do that is by uploading an artifact. To do that, add these two steps to the end of your `pull_request`-triggered workflow:
0 commit comments