Home > Development Tools > git > how to run github actions workflow manually

how to run github actions workflow manually

Mary-Kate Olsen
Release: 2024-10-09 16:01:16
Original
658 people have browsed it

How to trigger GitHub Actions workflows manually from the UI?

To manually trigger a GitHub Actions workflow from the UI, follow these steps:

  1. Navigate to the repository that contains the workflow you want to trigger.
  2. Click on the "Actions" tab.
  3. Find the workflow you want to trigger and click on the "Run workflow" button.

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>
Copy after login

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>
Copy after login

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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template