Valid GH-500 Dumps shared by ExamDiscuss.com for Helping Passing GH-500 Exam! ExamDiscuss.com now offer the newest GH-500 exam dumps, the ExamDiscuss.com GH-500 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com GH-500 dumps with Test Engine here:
You have a GitHub Enterprise Cloud Organization that uses GitHub Advanced Security code scanning with CodeQL advanced setup. The security engineering team at your company maintains a private repository named Repo1 that stores custom CodeQL queries and query suites for multiple languages. You discover that changes to the custom queries can introduce noisy results and break existing tests. The regressions are detected only after the queries are deployed to production repositories. You add a workflow step that runs CodeQL query tests on every pull request (PR). The step runs the following CodeQL CLI command. codeql test run ./tests You need to ensure that the workflow fails when query tests detect regressions. What should you configure in the workflow?
Correct Answer: C
To ensure that the GitHub Actions workflow fails when query tests detect regressions, you must configure the command or step to return a non-zero exit code on test failures. By default, the codeql test run command executes unit tests by comparing the query output against expected .expected files. Default Behavior: If any tests fail (meaning actual results deviate from the expected results), the CodeQL CLI natively emits a non-zero exit code (typically 1). CI Integration: In GitHub Actions, any step that executes a command returning a non-zero exit code will automatically fail the step and halt the workflow. The Risk: If the workflow is configured to suppress errors (e.g., using || true in a shell script, wrapping it in an accidental error-ignoring configuration, or setting continue-on-error: true at the step level), it will mask the failure by returning an exit code of 0. Reference: https://github.com/advanced-security/codeql-development-template/blob/main/resources/cli/qlt/qlt_test_run_execute-unit-tests.prompt.md