GH-500 · Question #91
What is the difference between scheduled versus triggered events in code scanning?
The correct answer is B. Scheduled events run based on a specified schedule and triggered events run on code events. Code scanning workflows support two execution models - scheduled scans that run at defined time intervals and triggered scans that run in response to specific repository events such as pushes or pull requests.
Question
What is the difference between scheduled versus triggered events in code scanning?
Options
- AScheduled events are more difficult to configure than triggered events.
- BScheduled events run based on a specified schedule and triggered events run on code events
- CTriggered events run less frequently than scheduled events.
- DScheduled events can only be set up by administrators.
How the community answered
(24 responses)- B96% (23)
- C4% (1)
Why each option
Code scanning workflows support two execution models - scheduled scans that run at defined time intervals and triggered scans that run in response to specific repository events such as pushes or pull requests.
Configuration complexity is not the distinguishing characteristic between scheduled and triggered events; both are defined in GitHub Actions workflow YAML files with comparable ease.
Scheduled events use a cron expression in the workflow YAML to run code scanning at fixed time intervals (e.g., nightly or weekly), regardless of developer activity, while triggered events fire automatically in response to code events such as push or pull_request, integrating scans directly into the development workflow.
Triggered events do not inherently run less frequently than scheduled events; a busy repository with many pushes per day will trigger scans far more often than a nightly scheduled scan.
Scheduled events are not restricted to administrators; any user with write access who can create or modify GitHub Actions workflow files can configure a scheduled code scanning workflow.
Concept tested: Code scanning scheduled versus event-triggered 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
Community Discussion
No community discussion yet for this question.