GH-200 GitHub Actions Exam Questions and Answers
Which scopes are available to define custom environment variables within a workflow file? (Choose three.)
As a developer, you need to integrate a GitHub Actions workflow with a third-party code quality provider that uses the Checks API. How should you trigger a follow-up workflow?
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?
What are the two types of environment protection rules you can configure? (Choose two.)
You are a developer working on developing reusable workflows for your organization. What keyword should be included as part of the reusable workflow event triggers?
What is the right method to ensure users approve a workflow before the next step proceeds?
Disabling a workflow allows you to stop a workflow from being triggered without having to delete the file from the repo. In which scenarios would temporarily disabling a workflow be most useful? (Choose two.)
Your organization needs to simplify reusing and maintaining automation in your GitHub Enterprise Cloud. Which components can be directly reused across all repositories in an organization? (Choose three.)
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
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 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?
As a developer, you need to use GitHub Actions to deploy a microservice that requires runtime access to a secure token. This token is used by a variety of other microservices managed by different teams in different repos. To minimize management overhead and ensure the token is secure, which mechanisms should you use to store and access the token? (Choose two.)
As a DevOps engineer, you need to execute a deployment to different environments like development and testing based on the labels added to a pull request. The deployment should use the releases branch and trigger only when there is a change in the files under apps folder. Which code block should be used to define the deployment workflow trigger?
Which of the following commands will set the $FOO environment variable within a script, so that it may be used in subsequent workflow job steps?
Which of the following statements are true regarding the use of GitHub Actions on a GitHub Enterprise Server instance? (Choose three.)
What are the two most significant advantages of adding documentation while distributing custom actions? Each correct answer presents a complete solution.
NOTE: Each correct answer is worth one point.
What is the minimal syntax for declaring an output named foo for an action?
A)

B)

C)

D)

Which choices represent best practices for publishing actions so that they can be consumed reliably? (Choose two.)
Your organization is managing secrets using GitHub encrypted secrets, including a secret named SuperSecret. As a developer, you need to create a version of that secret that contains a different value for use in a workflow that is scoped to a specific repository named MyRepo. How should you store the secret to access your specific version within your workflow?
How can GitHub Actions encrypted secrets be used in if: conditionals within a workflow job?
As a developer, you are authoring a workflow that will deploy to both DevCloud and TestCloud resources. Each cloud resource is accessed with a different deployment key. Which approach best allows you to use the same reusable workflow in separate jobs to target the different cloud resources?
Which default GitHub environment variable indicates the name of the person or app that initiated a workflow?
As a developer, which workflow steps should you perform to publish an image to the GitHub Container Registry? (Choose three.)
Your organization has a secret that must be available to all the repositories within GitHub Actions workflows.
You need to store the secret. The solution must minimize administrative effort.
What should you do in GitHub?
