In GitHub Actions, you can manually trigger a workflow to run. Here's how to configure the workflow to allow manual triggering:
- In your workflow file, you need to use
workflow_dispatch
events. This is a special event provided by GitHub Actions that allows you to trigger workflows manually through the GitHub UI or API. For example:
name: Manual workflow
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- You can then find the workflow in the "Actions" tab of your GitHub repository and click the "Run workflow" button to trigger it manually.
Note: You need to have write access to the repository to manually trigger the workflow.