nerdexam
Microsoft

GH-500 · Question #92

When code scanning is enabled, what is one default event that triggers a scan?

The correct answer is C. Pushing a change. When code scanning is enabled with default settings, a push event is one of the default triggers that automatically initiates a scan to detect vulnerabilities in newly introduced code.

Configure and use Code Scanning with CodeQL

Question

When code scanning is enabled, what is one default event that triggers a scan?

Options

  • ACreating a new branch.
  • BDeleting a branch.
  • CPushing a change.
  • DMerging a branch.

How the community answered

(34 responses)
  • A
    3% (1)
  • B
    6% (2)
  • C
    88% (30)
  • D
    3% (1)

Why each option

When code scanning is enabled with default settings, a push event is one of the default triggers that automatically initiates a scan to detect vulnerabilities in newly introduced code.

ACreating a new branch.

Creating a new branch is not a default code scanning trigger event; a subsequent push of commits to that branch is what initiates a scan, not the branch creation itself.

BDeleting a branch.

Deleting a branch removes code from active development and does not introduce new code, so it is not a meaningful or default trigger event for code scanning.

CPushing a change.Correct

Pushing a change is configured as a default trigger event in the code scanning workflow so that every new commit pushed to the repository immediately initiates a security scan, ensuring vulnerabilities introduced by new code are detected as early as possible in the development process.

DMerging a branch.

A branch merge is not a separate default trigger event in code scanning workflow configuration; the push event that results from the merge is what triggers the scan, not the merge action as its own distinct event type.

Concept tested: Default trigger events for code scanning workflow execution

Source: https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning

Topics

#Code scanning#Default triggers#Push event

Community Discussion

No community discussion yet for this question.

Full GH-500 Practice