`./config.sh --check ...` should return a non-zero exit code if any check fails.
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 1.4k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 24
Description
Describe the bug
Running ./config.sh --check --url ... --pat ... always exits with a status code of 0, which on linux indicates success. This is the case even when one or more of the checks fail.
The lack of an accurate exit code makes ./config --check useless as a docker HEALTHCHECK method without grepping the text output for F A I L (because the presentation seems to matter more than the information, I guess.)
To Reproduce
- Follow the published instructions to set up the runner app and generate a PAT.
- Per the published docs, run
./config.sh --check --url https://github.com/your/org-or-repo --pat ghp_1234abcdwith the appropriate values replaced. - Run
echo $? - The output will always be
0, even when one or more of the checks fails.
Expected behavior
If the STDOUT console output from the --check command contains F A I L anywhere, then the exit code should be non-zero.
Runner Version and Platform
Version of your runner?
v2.334.0
OS of the machine running the runner?
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04.4 LTS"
What's not working?
- The
Runnerclass's ExecuteCommand method branches when the provided cli command is "Check".
if (command.Check) - That branch loops over all available Checks, and inside the loop, stores the check's result temporarily.
var result = await check.RunCheck(url, pat); - But the code doesn't utilize the returned
resultfrom each check, and the final exit code is always "Success".
return Constants.Runner.ReturnCode.Success;
What should happen?
- The ReturnCode class should be updated to include a new error state code (if appropriate).
public const int CheckFailure = 8;for example. - The
if (command.Check)branch should define anexitCodevariable and initialize it toSuccess.
var exitCode = Constants.Runner.ReturnCode.Success; - In the case of if (!result) for any given check, change the value of
exitCodetoCheckFailure(or whatever the new constant is named).
exitCode = Constants.Runner.ReturnCode.CheckFailure; - The entire branch should exit with the value of
exitCode, instead of hard-coded "Success".
return exitCode;
Job Log Output
% ./config.sh --check --url $GITHUB_ORG_URL --pat $GITHUB_PAT
*********************************************************************************************
** Check: Internet Connection
** Description: Check if the Actions runner has internet access.
*********************************************************************************************
** **
** F A I L **
** **
*********************************************************************************************
** Log: /github/actions-runner/_diag/InternetCheck_20260430-171324-utc.log
** Help Doc: https://github.com/actions/runner/blob/main/docs/checks/internet.md
********************************************************************************************
********************************************************************************************
** Check: GitHub Actions Connection
** Description: Check if the Actions runner has access to the GitHub Actions service.
********************************************************************************************
** **
** F A I L **
** **
********************************************************************************************
** Log: /github/actions-runner/_diag/ActionsCheck_20260430-171324-utc.log
** Help Doc: https://github.com/actions/runner/blob/main/docs/checks/actions.md
********************************************************************************************
********************************************************************************************
** Check: Git Certificate/Proxy Validation
** Description: Check if the Git CLI can access GitHub.com or GitHub Enterprise Server.
********************************************************************************************
** **
** P A S S **
** **
********************************************************************************************
** Log: /github/actions-runner/_diag/GitCheck_20260430-171324-utc.log
********************************************************************************************
********************************************************************************************
** Check: Node.js Certificate/Proxy Validation
** Description: Check if Node.js has access to GitHub.com or GitHub Enterprise Server.
********************************************************************************************
** **
** P A S S **
** **
********************************************************************************************
** Log: /github/actions-runner/_diag/NodeJsCheck_20260430-171324-utc.log
********************************************************************************************
% echo $?
0
👆 Don't blame me for the formatting of this output, this is how the code is written.
Runner and Worker's Diagnostic Logs
The underlying cause of my personal --check failure isn't important to this issue, so the _diag logs aren't helpful.
But for the sake of completeness and reproducibility-- in my case, the host ubuntu server that was running the actions runner binary did not have the command line ping utility installed, causing the Internet Connection and GitHub Actions Connection tests to fail as seen above.
This itself might be a false-positive failure, since the ability to ping a tcp/ip host probably isn't strictly required for the runner to operate correctly as long as DNS resolution is working and HTTPS requests are permitted. 🤷♂️
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/Runner.Listener/Runner.cs at ExecuteCommand and its Check branch, then inspect the ReturnCode definitions in src/Runner.Common/Constants.cs. Run ./config.sh --check with a deliberately failing check and verify that the command returns non-zero while successful checks still return zero.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, github-actions, shell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100