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:
Muhammad Hammad 2022-07-05 16:35:05 -02:30 committed by GitHub
parent 4d9d6ecc92
commit 6837307212
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 43 additions and 0 deletions

View File

@ -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.