Microsoft GH-200 - GitHub Actions Exam
Page: 3 / 25
Total 124 questions
Question #11 (Topic: Topic 1, Author and maintain workflows
)
You are a DevOps engineer working on deployment workflows. You need to execute the deploy job only if the current branch name is feature-branch. Which code snippet will help you to implement the conditional execution of the job?
A. jobs:
deploy:
if: github.ref_name == 'feature-branch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 B. jobs:
deploy:
if: github.branch.name == 'feature-branch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 C. jobs:
deploy:
if: github.ref.name == 'feature-branch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 D. jobs:
deploy:
if: github.branch_name == 'feature-branch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
deploy:
if: github.ref_name == 'feature-branch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 B. jobs:
deploy:
if: github.branch.name == 'feature-branch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 C. jobs:
deploy:
if: github.ref.name == 'feature-branch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 D. jobs:
deploy:
if: github.branch_name == 'feature-branch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Answer: A
Question #12 (Topic: Topic 1, Author and maintain workflows
)
What are the mandatory requirements for publishing GitHub Actions to the GitHub Marketplace? (Each correct answer presents part of the solution. Choose two.)
A. The action can be either in a public or private repository.
B. The action’s metadata file must be in the root directory of the repository.
C. The action’s name cannot match a user or organization on GitHub unless the user or organization owner is publishing the action.
D. The name should match with one of the existing GitHub Marketplace categories.
E. Each repository can contain a collection of actions as long as they are under the same Marketplace category.
Answer: BC
Question #13 (Topic: Topic 1, Author and maintain workflows
)
Which of the following is the proper syntax to specify a custom environment variable named MY_VARIABLE with the value my-value?
A. var:
MY_VARIABLE = my-value B. environment:
MY_VARIABLE = my-value C. var:
MY_VARIABLE: my-value D. env:
MY_VARIABLE = my-value E. environment:
MY_VARIABLE: my-value F. env:
MY_VARIABLE: my-value
MY_VARIABLE = my-value B. environment:
MY_VARIABLE = my-value C. var:
MY_VARIABLE: my-value D. env:
MY_VARIABLE = my-value E. environment:
MY_VARIABLE: my-value F. env:
MY_VARIABLE: my-value
Answer: F
Question #14 (Topic: Topic 1, Author and maintain workflows
)
As a DevOps engineer, you need to define a deployment workflow that runs after the build workflow has successfully completed. Without modifying the build workflow, which trigger should you define in the deployment workflow?
A. repository_dispatch
B. workflow_dispatch
C. workflow_exec
D. workflow_run
Answer: D
Question #15 (Topic: Topic 1, Author and maintain workflows
)
Which step is using the dbserver environment variable correctly?
A. steps:
- name: Hello world
run: echo $dbserver
variables:
dbserver: orgserver1 B. steps:
- name: Hello world
run: echo $dbserver
env:
- name: dbserver
value: orgserver1 C. steps:
- name: Hello world
run: echo $dbserver
environment:
dbserver: orgserver1 D. steps:
- name: Hello world
run: echo $dbserver
env:
dbserver: orgserver1
- name: Hello world
run: echo $dbserver
variables:
dbserver: orgserver1 B. steps:
- name: Hello world
run: echo $dbserver
env:
- name: dbserver
value: orgserver1 C. steps:
- name: Hello world
run: echo $dbserver
environment:
dbserver: orgserver1 D. steps:
- name: Hello world
run: echo $dbserver
env:
dbserver: orgserver1
Answer: D