GH-200 · Question #56
In GitHub Actions, which workflow key defines the events that trigger the workflow such as push or pull_request?
The correct answer is B. on:. The on: key is the top-level workflow YAML key that defines one or more events that will trigger the workflow. For example, on: push triggers on every push, and on: [push, pull_request] triggers on both. The if: key (A) is used for conditional execution of jobs or steps. The env:
Question
In GitHub Actions, which workflow key defines the events that trigger the workflow such as push or pull_request?
Options
- Aif:
- Bon:
- Cenv:
- Djobs:
How the community answered
(47 responses)- A2% (1)
- B94% (44)
- D4% (2)
Explanation
The on: key is the top-level workflow YAML key that defines one or more events that will trigger the workflow. For example, on: push triggers on every push, and on: [push, pull_request] triggers on both. The if: key (A) is used for conditional execution of jobs or steps. The env: key (C) declares environment variables. The jobs: key (D) defines the jobs that make up the workflow. Only on: controls what events start the workflow.
Topics
Community Discussion
No community discussion yet for this question.