Skip to content

Commit 6837307

Browse files
mhnaeemcplee
andauthored
Improve docs for events inputs (nektos#1238)
* Added documentation on how to pass inputs for workflows that require them * Added the correct command to trigger the workflow Co-authored-by: Casey Lee <caseypl@amazon.com>
1 parent 4d9d6ec commit 6837307

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,49 @@ act -e pull-request.json
370370

371371
Act will properly provide `github.head_ref` and `github.base_ref` to the action as expected.
372372

373+
## Pass Inputs to Manually Triggered Workflows
374+
375+
Example workflow file
376+
377+
```yaml
378+
on:
379+
workflow_dispatch:
380+
inputs:
381+
NAME:
382+
description: "A random input name for the workflow"
383+
type: string
384+
SOME_VALUE:
385+
description: "Some other input to pass"
386+
type: string
387+
388+
jobs:
389+
test:
390+
name: Test
391+
runs-on: ubuntu-latest
392+
393+
steps:
394+
- name: Test with inputs
395+
run: |
396+
echo "Hello ${{ github.event.inputs.NAME }} and ${{ github.event.inputs.SOME_VALUE }}!"
397+
```
398+
399+
Example JSON payload file conveniently named `payload.json`
400+
401+
```json
402+
{
403+
"inputs": {
404+
"NAME": "Manual Workflow",
405+
"SOME_VALUE": "ABC"
406+
}
407+
}
408+
```
409+
410+
Command for triggering the workflow
411+
412+
```sh
413+
act workflow_dispatch -e payload.json
414+
```
415+
373416
# GitHub Enterprise
374417

375418
Act supports using and authenticating against private GitHub Enterprise servers.

0 commit comments

Comments
 (0)