Flashcardsfor IT Certifications

D1: YAML Anchors, Aliases & Merge Keys

GH-200 GitHub Actions exam practice questions · 10 flashcards

Question
YAML anchor (&)?
1 / 10

Tip: Space flips the card, ← / → navigate.

Last updated: · Report an error on this page

Show all 10 YAML Anchors, Aliases & Merge Keys practice questions and answers
  1. YAML anchor (&)?
    Marks a node for reuse, e.g. &common-env.
  2. YAML alias (*)?
    References an anchored node, e.g. *common-env.
  3. Merge key (<<)?
    Merges an anchored mapping into another mapping: <<: *defaults.
  4. Scope of anchors in Actions?
    Within a single workflow file only.
  5. Use case for anchors?
    Reuse repeated env blocks, step lists or container config.
  6. Anchors vs reusable workflows?
    Anchors: within one file. Reusable workflows/composite actions: across files/repos.
  7. Overriding merged keys?
    Keys defined locally override those merged via <<.
  8. Expanding anchors when debugging?
    Mentally/tooling resolve aliases to see the effective configuration.
  9. Anchor for steps list?
    Define a sequence with &steps and reuse with *steps (whole sequence).
  10. Scenario: same env vars repeated in 5 jobs in one file. Technique?
    Define anchor once and reference with aliases/merge keys.