Unlocking Manual Workflow Execution in GitHub Actions: A Quick Fix

If you’re working with CI/CD pipelines and GitHub Action workflows, there might be instances where you need to manually run a workflow. However, you might have noticed that when you attempt to do this through the portal, you realize that there’s no option available for manual execution. In this blog post, I’ll provide a quick solution to address this issue.

As below, there is no option available to work this workflow.

How to fix

When you encounter the situation mentioned earlier, where there’s no option to manually trigger a workflow, you can easily address this by making a simple adjustment. To enable manual execution, you just need to include the workflow_dispatch trigger within the configuration of your affected workflow.

Example as below

name: 'Terraform Deploy'
 
on:
  push:
    branches:
    - main
  pull_request:
  workflow_dispatch:

As highlighted in the example, I added workflow_dispatch to the on section of my workflow configuration.

After making this adjustment, check the GitHub portal. Now, you should see the option to manually run the workflow, providing you with the flexibility to execute it as needed.

Leave a Reply