Frecuentemente publicamos actualizaciones de nuestra documentación. Es posible que la traducción de esta página esté en curso. Para conocer la información más actual, visita la documentación en inglés. Si existe un problema con las traducciones en esta página, por favor infórmanos.

Manually running a workflow

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

GitHub Actions se encuentra disponible con GitHub Free, GitHub Pro, GitHub Free para organizaciones, GitHub Team, GitHub Enterprise Cloud, y GitHub One. GitHub Actions no se encuentra disponible para repositorios privados que pertenezcan a cuentas que utilicen planes tradicionales por repositorio.

En este artículo

Note: GitHub-hosted runners are not currently supported on Servidor de GitHub Enterprise. You can see more information about planned future support on the Itinerario público de GitHub.

Configuring a workflow to run manually

To run a workflow manually, the workflow must be configured to run on the workflow_dispatch event. For more information about configuring the workflow_dispatch event, see "Events that trigger workflows".

Running a workflow on GitHub

To trigger the workflow_dispatch event on GitHub, your workflow must be in the default branch. Follow these steps to manually trigger a workflow run.

Las personas con acceso de escritura en el repositorio pueden llevar a cabo estos pasos.

  1. En GitHub Enterprise, visita la página principal del repositorio.
  2. Debajo del nombre de tu repositorio, da clic en Acciones.
    Pestaña de acciones en la navegación del repositorio principal
  3. In the left sidebar, click the workflow you want to run.
    actions select workflow
  4. Above the list of workflow runs, select Run workflow.
    actions workflow dispatch
  5. Select the branch where the workflow will run and type the input parameters used by the workflow. Click Run workflow.
    actions manually run workflow

Running a workflow using CLI de GitHub

For information on setting up CLI de GitHub, see "Managing GitHub Actions with GitHub CLI."

To run a workflow, use the workflow run subcommand. Replace the workflow 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, CLI de GitHub returns an interactive menu for you to choose a workflow.

gh workflow run workflow

If your workflow accepts inputs, CLI de GitHub will prompt you to enter them. Alternatively, you can use -f or -F to add an input in key=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-name

To view the progress of the workflow run, use the run 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 the inputs and ref as request body parameters. If the inputs are omitted, the default values defined in the workflow file are used.

For more information about using the REST API, see the "Create a workflow dispatch event."

¿Te ayudó este documento?

Privacy policy

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

O, learn how to contribute.