How to start GitHub Actions manually?

In GitHub Actions, you can manually trigger a workflow to run. Here's how to configure the workflow to allow manual triggering:

  1. In your workflow file, you need to use workflow_dispatchevents. 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
  1. 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.

Guess you like

Origin blog.csdn.net/m0_57236802/article/details/131036694