QuestionQ20

Author and manage workflows

As a developer, you must add the correct syntax so the following workflow file can be triggered by multiple event types. Which two code blocks should you add beginning at line 5? (Each correct answer is a complete solution. Choose two.)

Question Image

Choose two
  • A on: [push, pull_request]
  • B on:branches:- 'main'- 'dev'
  • C on:schedule:- cron: '*/15 * * * *'initiate:- 'main'
  • D on: [push, commit]
  • E on:push:branches:- mainrelease:types:- created
  • F on:env:- 'prod'- 'qa'- 'test'
Explanation

GitHub Actions defines workflow triggers with the top-level on key. Multiple events may be supplied as an inline list, such as push and pull_request, or as separately configured event mappings. A push event can use a branches filter, and a release event can be limited with types: [created].

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!