The global pandemic and the craziness going on in the United States are CLEARLY super distracting because I just “discovered” a feature in GitHub Actions that I’ve been wanting forever. I can now manually trigger GitHub Actions!!!!
Apparently it’s been out for a month and somehow I missed it but man this makes me super happy.
How It Works
There is a new trigger that you can put in the on: section of your yaml for your manual trigger.
As you can see, this workflow has a trigger for pull requests. I also added the new trigger workflow_dispatch. This is the manual trigger. Under that you have your inputs, where you can pass in inputs into the workflow during run time. In this example I have two inputs. deployEnvironment and logLevel. deployEnvironment is required and logLevel is not.
To use those runtime inputs in your yaml, you would use them with github.event.inputs.<input name>:
And to manually trigger your workflow, you would now go to Actions > Name of your workflow where you now see a Run workflow drop down. Click that, fill in your runtime inputs if needed and click Run workflow button to manually trigger your workflow!