Forrest logo
back to the gh tool

gh-run:tldr:44a5c

gh-run: Check a specific workflow and exit with a non-zero status if the run failed.
$ gh run view ${workflow_run_number} --exit-status && ${echo "run pending or passed"}
try on your machine

This command can be broken down into two parts:

  1. gh run view ${workflow_run_number} --exit-status:

This part uses the gh command-line tool to view the details of a specific workflow run on GitHub Actions. The ${workflow_run_number} is a variable that represents the unique identifier of the workflow run. By providing this number, the command fetches information about the specified workflow run. The --exit-status flag ensures that the command exits with the appropriate status code.

  1. && ${echo "run pending or passed"}:

After executing the first part, && is a logical operator that allows the second part to execute only if the first part succeeds, meaning it has an exit status of zero. The second part consists of a simple echo command that outputs the string "run pending or passed" to the console.

To summarize, this command views the details of a specific workflow run using the gh tool, and if it is successful, it prints the message "run pending or passed" to the console.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the gh tool