0

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

  1. Does workflow_dispatch only work from the default branch?

  2. Why does the “Run workflow” button not appear when the workflow is in a feature branch?

  3. How can I make this workflow available for manual execution only, without running automatically on push?

  4. Is there a recommended way to avoid workflows failing because inputs are empty during push events?


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.

1 Answer 1

1

When you first time adding a workflow to a GitHub repo from a feature branch, if you want to test it before merge to main you must give it push trigger, without that - as you said - it won't appear in the UI.

How do you solve the empty values? when you call them you must provide a default with the value you want, for example: echo "${{ inputs.actions || 'create' }}".

After you finish your tests you can remove the push trigger and merge to main, only when the workflow is in main you can use the workflow_dispatch trigger, and now - even in side branches.

If you don't want to test with push and default values, you can merge it to main and then conitnue test in a feature branch.

Why is like this? I have no idea... but this is how GitHub Actions works...

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks ,it working ...I push into main branch ,workflow_dispatch trigger shows the run workflow and i get the user input to run the pipeling

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.