I want to pass some dynamic parameters and invoke my GitHub Actions workflow manually (ideally via some API). Is this possible?
On GitHub.com, navigate to the main page of the repository. Under your repository name, click Actions. In the left sidebar, click the workflow you want to run. Above the list of workflow runs, select Run workflow.
To run jobs sequentially, you can define dependencies on other jobs using the jobs. <job_id>. needs keyword. Each job runs in a runner environment specified by runs-on .
Run Actions on Pull Requests When creating a new workflow in GitHub's action builder the default trigger is the push event. You want to extend this to push and pull request events. Search the line on: [push] in your GitHub Action workflow file. Extend it to on: [push, pull_request] and you're done.
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:
Blog post announcement reference, https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With