nerdexam
Microsoft

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:

Author and Maintain Workflows

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)
  • A
    2% (1)
  • B
    94% (44)
  • D
    4% (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

#Workflow triggers#GitHub Actions syntax#on keyword

Community Discussion

No community discussion yet for this question.

Full GH-200 Practice