How to use workflow dispatch

hi,

I would like to use workflow_dispatch and enabled UI option to trigger workflow by passing parameters
please provide me detailed steps to do that

Here’s an example workflow file.

name: CI


on:
  workflow_dispatch:

After on, add in workflow_dispatch:. Then when you click on your workflow on the Actions tab, you’ll see the UI trigger is available.

1 Like

Hi @chaitanya-bojja-by,

To add parameter for ‘workflow_dispatch’ event, please follow sample as below:

on: 
  workflow_dispatch:
    inputs:
      logLevel:
        description: 'Log level'     
        required: true
        default: 'warning'
      tags:
        description: 'Test scenario tags'  


You can find more details here:
https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/#:~:text=You%20can%20now%20create%20workflows,the%20workflow%20is%20run%20on.

And please put the event in default(mostly master) branch, if you put event in other branch, please check my answer here.

Thanks