GH-200 GitHub Actions Exam Questions and Answers
You are a developer, and your container jobs are failing on a self-hosted runner. Which requirements must you check to ensure that the self-hosted runner is properly configured? (Choose two.)
What is the right method to ensure users approve a workflow before the next step proceeds?
Which scopes are available to define custom environment variables within a workflow file? (Choose three.)
You are reaching your organization ' s storage limit for GitHub artifacts and packages. What should you do to prevent the storage limit from being reached? (Choose two.)
You have a private GitHub repository that has GitHub Actions enabled. You need to create a CI workflow that can be used by GitHub Actions. You select an organization-approved workflow template.
What should you do next?
You need to stop a GitHub Actions workflow from running. The solution must retain the configuration and execution history of the workflow.
What should you do?
Which files are required for a Docker container action in addition to the source code? (Choose two.)
How can GitHub Actions encrypted secrets be used in if: conditionals within a workflow job?
In which of the following scenarios should you use self-hosted runners? Each correct answer presents a complete solution.
NOTE: Each correct answer is worth one point.
Which of the following scenarios requires a developer to explicitly use the GITHUB_TOKEN or github.token secret within a workflow? (Choose two.)
As a developer, you are configuring GitHub Actions to deploy VMs to production. A member of the VMOps team must provide approval before the deployment occurs. Which two steps should you take? Each correct answer presents part of the solution.
NOTE: Each correct answer is worth one point.
As a developer, you need to create a custom action written in Python. Which action type should you choose?
What is the most secure way to store sensitive information in GitHub Actions workflows?
A single secret must be accessed by workflows in specific repositories. What is the best way to create the secret?
Which of the following is the lowest repository permission you need to have for downloading workflow artifacts?
As a developer, your self-hosted runner sometimes looses connection while running jobs. How should you troubleshoot the issue affecting your self-hosted runner?
You have a GitHub Enterprise Cloud Organization that contains private repositories for three apps. The workflow of each app has a job that uses repository secrets and calls a shared deployment action.
You plan to replace separate deployment scripts with a single custom action.
You need to recommend a distribution and versioning approach for the custom action. The solution must meet the following requirements:
The action repository must be private.
Only specific application repositories can use the action.
The workflow reference must be resistant to changes in the action repository without requiring a workflow file change.
What should you recommend?
What is the most suitable action type for a custom action written in TypeScript?
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.)
You need to perform a task that requires running a custom script in a GitHub Actions workflow. The script must run within the workflow environment without requiring an external container or prebuilt image.
What should you use?
What menu options in a repository do you need to select in order to use a starter workflow that is provided by your organization?
Which of the following is the proper syntax to specify a custom environment variable named MY_VARIABLE with the value my-value?
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?
For which type of GitHub Actions workflows should you use a self hosted runner?
Which action type should be used to bundle a series of run steps into a reusable custom action?
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 of the following commands will set the $FOO environment variable within a script, so that it may be used in subsequent workflow job steps?
Without the need to use additional infrastructure, what is the simplest and most maintainable method for configuring a workflow job to provide access to an empty PostgreSQL database?
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 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?
You are a DevOps engineer working on custom Actions development. You need to handle the errors or exceptions as part of the JavaScript-based action code. What should be added to the following code block to handle errors?
Exhibit:
const core = require( ' @actions/core ' );
try {
// action code
} catch (error) {
< < insert snippet here > >
}
As a developer, you have a 10-MB data set that is required in a specific workflow. Which steps should you perform so the dataset is stored encrypted and can be decrypted during the workflow? (Choose three.)
You are a DevOps engineer in ABC Corp. You need to schedule your deployment workflow twice a week at 7:45 UTC every Wednesday and Saturday. What is the appropriate YAML structure?
An organization ' s policies specify that only local actions are allowed. How should actions be distributed for this organization?
Which command can you include in your workflow file to set the output parameter for an action?
As a developer, you need to make sure that only actions from trusted sources are available for use in your GitHub Enterprise Cloud organization. Which of the following statements are true? (Choose three.)