Nota: Los ejecutores hospedados en GitHub no son compatibles con GitHub Enterprise Server actualmente. Puedes encontrar más información sobre el soporte que se tiene planeado en el futuro en el 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. To trigger the workflow_dispatch
event, your workflow must be in the default branch. For more information about configuring the workflow_dispatch
event, see "Events that trigger workflows".
Se requiere tener acceso de escritura en el repositorio para llevar a cabo estos pasos.
Running a workflow
- En tu instancia de GitHub Enterprise Server, visita la página principal del repositorio.
- Debajo de tu nombre de repositorio, haz clic en Acciones.
- In the left sidebar, click the workflow you want to run.
- Above the list of workflow runs, select Run workflow.
- Use the Branch dropdown to select the workflow's branch, and type the input parameters. Click Run workflow.
Para aprender más sobre el CLI de GitHub, consulta la sección "Acerca del CLI de GitHub".
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.
Note: You can define up to 10 inputs
for a workflow_dispatch
event.
For more information about using the REST API, see the "Create a workflow dispatch event."