I’m trying to create a GitHub Actions workflow that manages AWS Secrets Manager (create/read/update/delete). The workflow should only run manually using workflow_dispatch, because it requires user inputs.
However, I am facing two issues:
1. workflow_dispatch inputs do NOT appear in the Actions tab
Here is the beginning of my workflow file:
on:
workflow_dispatch:
inputs:
action:
description: "create | read | update | delete"
type: choice
required: true
options:
- create
- read
- update
- delete
secret_name:
description: "AWS secret name"
required: true
type: string
key:
description: "JSON key"
required: true
type: string
value:
description: "Value (required only for create/update)"
required: false
type: string
When this YAML file exists only in a feature branch, the workflow does not appear in the Actions tab, so I cannot run it manually.
2. If I add push or PR triggers, the workflow runs automatically and fails
If I add:
on:
workflow_dispatch:
push:
Then the workflow finally appears in the Actions UI — but as soon as I push, the workflow auto-runs with empty inputs:
ACTION=""
SECRET=""
KEY=""
VALUE=""
Invalid action!!
Error: Process completed with exit code 1.
This happens because github.event.inputs.* are empty during a push event.
My Questions
Does
workflow_dispatchonly work from the default branch?Why does the “Run workflow” button not appear when the workflow is in a feature branch?
How can I make this workflow available for manual execution only, without running automatically on push?
Is there a recommended way to avoid workflows failing because inputs are empty during
pushevents?
Additional Details
The shell script inside the job expects non-empty inputs.
I want the workflow to be visible in the Actions tab even before merging to main.
The workflow should never auto-run on push or PR.