|
1 | 1 | # Print Workflow Dispatch Inputs and Env Vars
|
2 | 2 |
|
3 |
| -This GitHub Action prints all input values from a `workflow_dispatch` event to the log. Optionally, it can also print all environment variables. It's a simple and effective tool for debugging or verifying input values and environment settings in your manually triggered workflows. |
| 3 | +This GitHub Action prints all input values from a `workflow_dispatch` event to the log. Optionally, it can also print environment variables and add inputs to the GitHub Summary in a collapsible format. |
4 | 4 |
|
5 | 5 | ## Features
|
6 | 6 |
|
7 | 7 | - Prints all `workflow_dispatch` inputs to the log
|
8 | 8 | - Optionally prints all environment variables
|
| 9 | +- Optionally adds inputs to GitHub Summary in a collapsible format |
9 | 10 | - Minimal configuration required
|
10 |
| -- Doesn't require a GitHub token |
11 | 11 | - Lightweight and fast
|
12 | 12 |
|
13 | 13 | ## Usage
|
@@ -36,24 +36,21 @@ jobs:
|
36 | 36 | - name: Print Workflow Dispatch Inputs and Env Vars
|
37 | 37 | uses: shayki5/print-workflow-dispatch-inputs@v1
|
38 | 38 | with:
|
39 |
| - print_env_vars: 'true' # Set 'true' to print environment variables as well (default: false) |
| 39 | + print_env_vars: 'true' # Set to 'true' to print environment variables |
| 40 | + add_to_summary: 'true' # Set to 'true' to add inputs to GitHub Summary |
40 | 41 | ```
|
41 | 42 |
|
42 |
| -When you manually trigger this workflow and provide values for the inputs, the action will print these input values to the log. If `print_env_vars` is set to 'true', it will also print all environment variables. |
43 |
| - |
44 | 43 | ## Inputs
|
45 | 44 |
|
46 | 45 | | Input | Description | Required | Default |
|
47 | 46 | |-------|-------------|----------|---------|
|
48 | 47 | | `print_env_vars` | Whether to print environment variables | No | 'false' |
|
| 48 | +| `add_to_summary` | Whether to add inputs to GitHub Summary | No | 'false' | |
49 | 49 |
|
50 |
| -## How it Works |
51 |
| - |
52 |
| -This action reads the event payload from the `GITHUB_EVENT_PATH` environment variable, which is automatically set by GitHub Actions. It then uses `jq` to extract and print the input values. If `print_env_vars` is set to 'true', it also prints all environment variables using the `env` command. |
53 | 50 |
|
54 |
| -## Requirements |
| 51 | +## GitHub Summary |
55 | 52 |
|
56 |
| -This action is designed to work with `workflow_dispatch` events. It will not print inputs for other event types, but can still print environment variables if enabled. |
| 53 | +When `add_to_summary` is set to 'true', the action will add the workflow dispatch inputs to the GitHub Summary in a collapsible format. This allows you to easily view the inputs without cluttering the summary. |
57 | 54 |
|
58 | 55 | ## License
|
59 | 56 |
|
|
0 commit comments