githubgithub-actionsworkflow-dispatch

Invoke GitHub Actions workflow manually and pass parameters


I want to pass some dynamic parameters and invoke my GitHub Actions workflow manually (ideally via some API). Is this possible?


Solution

  • With the workflow_dispatch event trigger, you can do the manual triggers easily.

    Flow:

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

    Manual trigger screenshot: screenshot

    Blog post announcement reference, https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/