Skip to content

Commit 265d64d

Browse files
committed
docs: add basic example and linkf ro workflow_dispatch
1 parent 4660e3a commit 265d64d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

content/actions/managing-workflow-runs/manually-running-a-workflow.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ versions:
1010
{% data reusables.actions.enterprise-beta %}
1111
{% data reusables.actions.enterprise-github-hosted-runners %}
1212

13-
To run a workflow manually, the workflow must be configured to run on the `workflow_dispatch` event. For more information, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows)."
13+
### Configuring a workflow to run manually
14+
15+
To run a workflow manually, the workflow must be configured to run on the `workflow_dispatch` event. For more information about configuring the `workflow_dispatch` event, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)".
1416

1517
### Running a workflow on {% data variables.product.prodname_dotcom %}
1618

content/actions/reference/events-that-trigger-workflows.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ You can manually trigger a workflow run using the {% data variables.product.prod
9898

9999
To trigger the custom `workflow_dispatch` webhook event using the REST API, you must send a `POST` request to a {% data variables.product.prodname_dotcom %} API endpoint and provide the `ref` and any required `inputs`. For more information, see the "[Create a workflow dispatch event](/rest/reference/actions/#create-a-workflow-dispatch-event)" REST API endpoint.
100100

101+
##### Example
102+
103+
To use the `workflow_dispatch` event, you need to include it as a trigger in your GitHub Actions YAML. The example below only run a GitHub Action when it's manually triggered:
104+
105+
```yaml
106+
on: workflow_dispatch
107+
```
108+
101109
##### Example workflow configuration
102110
103111
This example defines the `name` and `home` inputs and prints them using the `github.event.inputs.name` and `github.event.inputs.home` contexts. If a `name` isn't provided, the default value 'Mona the Octocat' is printed.

0 commit comments

Comments
 (0)