GitHub Actions Exam Questions and Answers
As a developer, you want to review the step that caused a workflow failure and the failed step ' s build logs. First navigate to the main page of the repository on GitHub. Which section contains the step failure information?
Which workflow commands send information from the runner? (Choose two.)
Which of the following is the best way for an enterprise to prevent certain marketplace actions from running?
As a developer, what is the safest way to reference an action to prevent modification of the underlying code?
As a developer, you want to run a workflow from the Actions tab in GitHub. Which YAML snippet should you use to match the interface in this image?

A)

B)

C)
D)

Which choices represent best practices for publishing actions so that they can be consumed reliably? (Choose two.)
As a developer, you created a JavaScript action. What is the best way to test your JavaScript action?
Custom environment variables can be defined at multiple levels within a workflow file, including which three levels?
(Each correct answer presents a complete solution. Choose three.)
Which workflow event is used to manually trigger a workflow run?
As a developer, you need to create a custom action written in Python. Which action type should you choose?
As a developer, how can you identify a composite action on GitHub?
You create a self-hosted runner labeled as runner1.
You need to ensure that a GitHub Actions workflow job runs only on runner1.
Which YAML statement should you use?
Which choices represent best practices for publishing actions so that they can be consumed reliably?
(Each correct answer presents a complete solution. Choose two.)
As a developer, you are optimizing a GitHub workflow that uses and produces many different files. You need to determine when to use caching versus workflow artifacts. Which two statements are true? (Choose two.)
As a developer, which workflow steps should you perform to publish an image to the GitHub Container Registry? (Choose three.)
As a developer, you need to add the correct syntax to allow the following workflow file to be triggered by multiple types of events.
Which two code blocks should you add starting at line 5? Each correct answer presents a complete solution.
NOTE: Each correct answer is worth one point.
4 name: Node CI/CD
5
6
7
8 jobs:
9 build:
10 runs-on:
11 steps:
12 - uses: actions/checkout@v2
13 - uses: actions/setup-node@v1
14 with:
15 node-version: 12
16 - run: npm ci
17 - run: npm test
18
As a DevOps engineer developing a JavaScript action, you need to include annotations to pass warning messages to workflow runners. Which code snippet can you use to implement an annotation in your Actions?
As a DevOps engineer developing a JavaScript action, you need to include annotations to pass warning messages to workflow runners. Which code snippet can you use to implement an annotation in your Actions?
What are the advantages of using a matrix strategy in a job definition? (Choose two.)
You need to make a script to retrieve workflow run logs by using the API. Which is the correct API endpoint to download a workflow run log?
Which native method should you use to pass files between jobs within the same GitHub Actions workflow?
Where should workflow files be stored to be triggered by events in a repository?
Which action type should be used to bundle a series of run steps into a reusable custom action?
As a DevOps engineer, you are developing a composite action. You have a step that needs to be executed against a subdirectory. Which code snippet should you use within the composite action to specify the directory?
As a developer, you need to create a custom action written in Python. Which action type should you choose?
As a developer, you need to create a custom action written in Python. Which action type should you choose?
Which two actions ensure that a GitHub Actions workflow can be triggered manually? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.
Which of the following statements are true regarding the use of GitHub Actions on a GitHub Enterprise Server instance? (Choose three.)
Which workflow command would output the debug message " action successfully debugged " ?
What is the most secure way to store sensitive information in GitHub Actions workflows?
As a developer, one of your workflows requires Xcode version 11.2 hosted on macOS Catalina (version 10.15). You have already created and configured a self-hosted runner to conform to those requirements and registered it with your organization. What else should you do to ensure that the workflow accesses the correct runner instance?
(Each correct answer presents part of the solution. Choose three.)
As a DevOps engineer, you are trying to leverage an organization secret in a repo. The value received in the workflow is not the same as that set in the secret. What is the most likely reason for the difference?
As a developer, your self-hosted runner sometimes loses its connection while running jobs. How should you troubleshoot the issue affecting your self-hosted runner?
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?
You need to trigger a workflow using the GitHub API for activity that happens outside of GitHub. Which workflow event do you use?
When reviewing an action for use, what file defines its available inputs and outputs?
What can be used to set a failed status of an action from its code?
As a developer, how can you identify a JavaScript action on GitHub?
Which of the following scenarios would require the use of self-hosted runners instead of GitHub-hosted runners?
What is the proper syntax to reference the system-provided run number variable?
In the following workflow file, line 5 interprets lines 3 and 4 as Python. Which of the following is a valid option to complete line 5?
1 steps:
2 - run: |
3 import os
4 print(os.environ[ ' PATH ' ])
5
A development team has been using a Powershell script to compile and package their solution using existing tools on a Linux VM, which has been configured as a self-hosted runner. They would like to use the script as-is in an automated workflow. Which of the following should they do to invoke their script within a workflow step?
Which run: command will set a step ' s output?