Home >Development Tools >git >how to run github actions workflow manually
How to trigger GitHub Actions workflows manually from the UI?
To manually trigger a GitHub Actions workflow from the UI, follow these steps:
Can I execute GitHub Actions workflows manually via the command line?
Yes, you can execute GitHub Actions workflows manually via the command line using the gh
CLI. To do this, run the following command:
<code>gh workflow run <workflow-name></code>
Replace <workflow-name>
with the name of the workflow you want to trigger.
How to initiate GitHub Actions workflows on demand using the API?
To initiate GitHub Actions workflows on demand using the API, you can use the POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches
endpoint. This endpoint requires authentication via an OAuth token with the workflows
scope.
Here is an example request body:
<code class="JSON">{ "ref": "refs/heads/main", "inputs": { "example_input": "my_input_value" } }</code>
Replace {owner}
with the owner of the repository, {repo}
with the name of the repository, and {workflow_id}
with the ID of the workflow you want to trigger.
The above is the detailed content of how to run github actions workflow manually. For more information, please follow other related articles on the PHP Chinese website!