Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Microsoft GH-200 Exam - Topic 2 Question 19 Discussion

As a DevOps engineer, you are developing workflows to build an application. You have a requirement to create the build targeting multiple node versions. Which code block should you use to define the workflow?
B) jobs:build-app:strategy:matrix:node-ver: [10, 12, 14]steps:- uses: actions/setup-node@v3with:node-version: ${{ matrix.node-ver }}
A) jobs:build-app:strategy:matrix:node-ver: [10, 12, 14]steps:- uses: actions/setup-node@v3with:node-version: ${{ strategy.node-ver }}
C) jobs:build-app:matrix-strategy:node-ver: [10, 12, 14]steps:- uses: actions/setup-node@v3with:node-version: ${{ matrix-strategy.node-ver }}
D) jobs:build-app:matrix:strategy:node-ver: [10, 12, 14]steps:- uses: actions/setup-node@v3with:node-version: ${{ matrix.node-ver }}

Microsoft GH-200 Exam - Topic 2 Question 19 Discussion

Actual exam question for Microsoft's GH-200 exam
Question #: 19
Topic #: 2
[All GH-200 Questions]

As a DevOps engineer, you are developing workflows to build an application. You have a requirement to create the build targeting multiple node versions. Which code block should you use to define the workflow?

Show Suggested Answer Hide Answer
Suggested Answer: B

The correct GitHub Actions syntax for running a job across multiple Node.js versions is strategy.matrix. The matrix values are referenced at runtime through the matrix context, so node-version: ${{ matrix.node-ver }} is correct. Option A defines the matrix correctly but references it incorrectly through strategy.node-ver; matrix values are not accessed through the strategy context. Option C uses matrix-strategy, which is not a valid GitHub Actions workflow key. Option D reverses the structure by putting strategy under matrix, which is invalid. This question tests matrix strategy syntax, dynamic job configuration, and using matrix values as inputs to actions such as actions/setup-node. GitHub defines jobs.<job_id>.strategy.matrix as the proper matrix mechanism.


Contribute your Thoughts:

0/2000 characters

Currently there are no comments in this discussion, be the first to comment!


Save Cancel