Improve docs for events inputs (#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>
This commit is contained in:
parent
4d9d6ecc92
commit
6837307212
43
README.md
43
README.md
|
@ -370,6 +370,49 @@ act -e pull-request.json
|
||||||
|
|
||||||
Act will properly provide `github.head_ref` and `github.base_ref` to the action as expected.
|
Act will properly provide `github.head_ref` and `github.base_ref` to the action as expected.
|
||||||
|
|
||||||
|
## Pass Inputs to Manually Triggered Workflows
|
||||||
|
|
||||||
|
Example workflow file
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
NAME:
|
||||||
|
description: "A random input name for the workflow"
|
||||||
|
type: string
|
||||||
|
SOME_VALUE:
|
||||||
|
description: "Some other input to pass"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Test with inputs
|
||||||
|
run: |
|
||||||
|
echo "Hello ${{ github.event.inputs.NAME }} and ${{ github.event.inputs.SOME_VALUE }}!"
|
||||||
|
```
|
||||||
|
|
||||||
|
Example JSON payload file conveniently named `payload.json`
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"inputs": {
|
||||||
|
"NAME": "Manual Workflow",
|
||||||
|
"SOME_VALUE": "ABC"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Command for triggering the workflow
|
||||||
|
|
||||||
|
```sh
|
||||||
|
act workflow_dispatch -e payload.json
|
||||||
|
```
|
||||||
|
|
||||||
# GitHub Enterprise
|
# GitHub Enterprise
|
||||||
|
|
||||||
Act supports using and authenticating against private GitHub Enterprise servers.
|
Act supports using and authenticating against private GitHub Enterprise servers.
|
||||||
|
|
Loading…
Reference in New Issue