Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
GitHub Docs

Manually running a workflow

When a workflow is configured to run on theworkflow_dispatch event, you can run the workflow using the Actions tab on GitHub, GitHub CLI, or the REST API.

Tool navigation

Configuring a workflow to run manually

To run a workflow manually, the workflow must be configured to run on theworkflow_dispatch event.

To trigger theworkflow_dispatch event, your workflow must be in the default branch. For more information about configuring theworkflow_dispatch event, seeEvents that trigger workflows.

Write access to the repository is required to perform these steps.

Running a workflow

  1. On GitHub, navigate to the main page of the repository.

  2. Under your repository name, click Actions.

    Screenshot of the tabs for the "github/docs" repository. The "Actions" tab is highlighted with an orange outline.

  3. In the left sidebar, click the name of the workflow you want to run.

    Screenshot of the "Actions" page. In the left sidebar, a workflow name is highlighted with an outline in dark orange.

  4. Above the list of workflow runs, click theRun workflow button.

    Note

    To see theRun workflow button, your workflow file must use theworkflow_dispatch event trigger. Only workflow files that use theworkflow_dispatch event trigger will have the option to run the workflow manually using theRun workflow button. For more information about configuring theworkflow_dispatch event, seeEvents that trigger workflows.

    Screenshot of a workflow page. Above the list of workflow runs, a button, labeled "Run workflow", is outlined in dark orange.

  5. Select theBranch dropdown menu and click a branch to run the workflow on.

  6. If the workflow requires input, fill in the fields.

  7. ClickRun workflow.

Note

To learn more about GitHub CLI, seeAbout GitHub CLI.

To run a workflow, use theworkflow run subcommand. Replace theworkflow parameter with either the name, ID, or file name of the workflow you want to run. For example,"Link Checker",1234567, or"link-check-test.yml". If you don't specify a workflow, GitHub CLI returns an interactive menu for you to choose a workflow.

gh workflow run WORKFLOW

If your workflow accepts inputs, GitHub CLI will prompt you to enter them. Alternatively, you can use-f or-F to add an input inkey=value format. Use-F to read from a file.

gh workflow run greet.yml -f name=mona -f greeting=hello -F data=@myfile.txt

You can also pass inputs as JSON by using standard input.

echo '{"name":"mona", "greeting":"hello"}' | gh workflow run greet.yml --json

To run a workflow on a branch other than the repository's default branch, use the--ref flag.

gh workflow run WORKFLOW --ref BRANCH

To view the progress of the workflow run, use therun watch subcommand and select the run from the interactive list.

gh run watch

Running a workflow using the REST API

When using the REST API, you configure theinputs andref as request body parameters. If the inputs are omitted, the default values defined in the workflow file are used.

Note

You can define up to 10inputs for aworkflow_dispatch event.

For more information about using the REST API, seeREST API endpoints for workflows.


[8]ページ先頭

©2009-2025 Movatter.jp