GH-900 · Domain 4: Apply modern development practices · 13% of the exam
Task 4.1: Automation and AI tools
What GitHub Actions does, how GitHub Copilot helps with suggestions, chat and agents, the Copilot plans, GitHub Codespaces and dev containers, and when the github.dev editor is enough.
Study it
GitHub Actions: workflows, events, runners and the Marketplace
Lesson coming
How Copilot produces code suggestions and chat answers
Try each one before opening the answer. Every option is explained, with the GitHub documentation page that proves it.
Question 1 · choose 1
A developer wants to add a GitHub Actions workflow that builds and tests every pull request in her repository. Where does the workflow definition go?
AIn the repository's README under a "CI" heading
BIn a JSON file named actions.json in the repository root
CIn the organization's settings, outside any repository
DIn a YAML file in the repository's .github/workflows directory
Show the answer and why
AIn the repository's README under a "CI" heading
Incorrect
GitHub doesn't read workflows from the README.
BIn a JSON file named actions.json in the repository root
Incorrect
Workflows are YAML files in .github/workflows.
CIn the organization's settings, outside any repository
Incorrect
Workflows live in the repository whose events trigger them.
DIn a YAML file in the repository's .github/workflows directory
Correct
Workflows are defined by YAML files checked in to .github/workflows.
A workflow is a configurable automated process that runs one or more jobs. Workflows are defined by YAML files checked in to the .github/workflows directory of a repository, and a repository can have several, for example one to build and test pull requests and another to deploy releases.
A workflow has a test job and a deploy job. In the first run, deploy started at the same moment as test and shipped code whose tests later failed. Deploy must start only after test succeeds. What should the team change?
APut the deploy job above the test job in the workflow file
BMake the deploy job depend on the test job
CMove both jobs onto the same self-hosted runner
DSplit deploy into its own workflow triggered by the same event
Show the answer and why
APut the deploy job above the test job in the workflow file
Incorrect
The order of jobs in the file doesn't create a dependency.
BMake the deploy job depend on the test job
Correct
Jobs run in parallel unless a job takes a dependency on another, in which case it waits for that job to complete.
CMove both jobs onto the same self-hosted runner
Incorrect
The runner type doesn't make one job wait for another.
DSplit deploy into its own workflow triggered by the same event
Incorrect
A separate workflow on the same event would still start at the same time.
A job is a set of steps executed on the same runner, and steps within a job run in order. By default, jobs have no dependencies and run in parallel. When a job takes a dependency on another job, it waits for that job to complete before running, which lets you build, test and then deploy in sequence.
A workflow builds an installer, and the release manager must download that exact installer after the run has finished. A colleague suggests using the dependency cache for it. Which feature fits?
AThe dependency cache, keyed on the installer's file name
BA larger GitHub-hosted runner
CA repository secret that stores the installer
DAn artifact uploaded at the end of the build
Show the answer and why
AThe dependency cache, keyed on the installer's file name
Incorrect
Caching is for reusing files that rarely change between runs; a job must be able to work without it.
BA larger GitHub-hosted runner
Incorrect
A bigger runner doesn't keep files after the run.
CA repository secret that stores the installer
Incorrect
A secret isn't a place to keep a build output such as an installer.
DAn artifact uploaded at the end of the build
Correct
Artifacts save files produced by a job so you can use or view them after the run ends.
Artifacts and caching both store files on GitHub but serve different purposes. Use artifacts to save files produced by a job, such as built binaries or build logs, to use or view after a workflow run has ended, or to pass files between jobs. Use caching to reuse files that don't change often between runs, such as downloaded dependencies, to speed up workflows.
A developer wants Copilot to take a task such as "add input validation to the signup flow and make the tests pass", find the files involved, edit them, run the tests and fix failures, while she reviews and approves commands. Which way of working with Copilot in her IDE fits?
AAgent mode
BInline suggestions while she types
CA pull request summary
DA single Copilot Chat question in ask mode
Show the answer and why
AAgent mode
Correct
In agent mode Copilot decides which files to change, makes edits and runs commands, iterating until the task is complete.
BInline suggestions while she types
Incorrect
Inline suggestions complete code as you type; they don't plan and run multi-step tasks.
CA pull request summary
Incorrect
A summary describes changes; it doesn't make them.
DA single Copilot Chat question in ask mode
Incorrect
Asking a question gets an answer; it doesn't edit files and run tests on its own.
In agent mode, Copilot takes a high-level task, decides which files to change, makes the edits and runs commands as needed, iterating until the task is done. You stay in control: you review the changes, and by default you approve commands before they run. Agent mode suits complex tasks with several steps, iterations and error handling.
An organization on GitHub Team wants Copilot for 30 developers, with seats and Copilot policies managed centrally by the organization instead of each developer buying a personal plan. Which plan fits?
ACopilot Enterprise
BCopilot Business
CCopilot Free for each developer
DCopilot Pro+ for each developer
Show the answer and why
ACopilot Enterprise
Incorrect
Copilot Enterprise is designed for enterprises using GitHub Enterprise Cloud, which this organization doesn't have.
BCopilot Business
Correct
Copilot Business offers centralized management and policy control, and owners of organizations on GitHub Free or GitHub Team can buy it.
CCopilot Free for each developer
Incorrect
Copilot Free is for individuals and offers no organization management.
DCopilot Pro+ for each developer
Incorrect
Individual plans are bought and managed by each person, not by the organization.
Copilot Business is made for organizations and enterprises and offers centralized management and Copilot policy control for organization members; owners of organizations on GitHub Free or GitHub Team can purchase it. Copilot Enterprise is designed for enterprises using GitHub Enterprise Cloud and includes everything in Business plus more. Copilot Free, Pro, Pro+ and Max are individual plans.
A reviewer presses the period key on a pull request and gets an editor in the browser instantly. She now wants to run the project's test suite in a terminal before approving, without installing anything locally. What should she do?
AOpen the integrated terminal in VS Code for the Web
BOpen it in a codespace, which gives her a VM with a terminal
CInstall a test-runner extension in VS Code for the Web and run it there
DRun the tests from GitHub Mobile
Show the answer and why
AOpen the integrated terminal in VS Code for the Web
Incorrect
VS Code for the Web has no compute, so there is no integrated terminal for running code.
BOpen it in a codespace, which gives her a VM with a terminal
Correct
A codespace has a dedicated VM where she can run and debug code and use the terminal.
CInstall a test-runner extension in VS Code for the Web and run it there
Incorrect
Extensions can't add the compute that running tests needs.
DRun the tests from GitHub Mobile
Incorrect
GitHub Mobile doesn't run code.
Pressing . on a repository or pull request opens VS Code for the Web (github.dev), a free, lightweight editor that starts instantly but has no associated compute: you can't build and run code or use an integrated terminal. A codespace gets a dedicated VM, so you can run and debug your application and use the terminal; it takes a little longer to start.
A team wants every codespace created for its repository to come with the same Node.js version, linter and VS Code extensions, without each developer setting them up by hand. What should the team add to the repository?
AA CONTRIBUTING file listing the tools to install
BA GitHub Actions workflow that installs the tools
CA devcontainer.json file in the repository's .devcontainer folder
DNothing, because the default dev container configuration sets up each repository's tools on its own
Show the answer and why
AA CONTRIBUTING file listing the tools to install
Incorrect
A document asks people to install tools; it doesn't configure the codespace.
BA GitHub Actions workflow that installs the tools
Incorrect
Workflows run on runners, not in developers' codespaces.
CA devcontainer.json file in the repository's .devcontainer folder
Correct
devcontainer.json defines the environment of codespaces created for the repository, including tools and extensions.
DNothing, because the default dev container configuration sets up each repository's tools on its own
Incorrect
Without a configuration in the repository, codespaces get a default one with common tools, not this project's chosen versions and extensions.
Dev container configuration files live in a .devcontainer directory. The primary file, devcontainer.json, defines a dev container that can include frameworks, tools, extensions and port forwarding, and usually references a Dockerfile. Without one, codespaces use a default configuration. Committing it gives everyone a repeatable environment.
Besides building and testing code, what else can a GitHub Actions workflow do?
AReact to repository events, such as labeling new issues
BReplace the need for a Git repository
CChange the plan of the organization
DTranslate the GitHub interface into another language for visitors
Show the answer and why
AReact to repository events, such as labeling new issues
Correct
Workflows can run when other events happen in a repository.
BReplace the need for a Git repository
Incorrect
Workflows live in a repository.
CChange the plan of the organization
Incorrect
Billing plans aren't changed by workflows.
DTranslate the GitHub interface into another language for visitors
Incorrect
That isn't what Actions does.
GitHub Actions is a CI/CD platform, but it goes beyond DevOps: you can run workflows when other events happen in a repository, for example to add the appropriate labels whenever someone creates a new issue.
BA dashboard that shows how much Actions and Codespaces usage an account has
CAn AI assistant that suggests code, answers questions and works on tasks
DA cloud development environment
Show the answer and why
AA hosting service for websites
Incorrect
Copilot is an AI coding assistant, not a hosting service.
BA dashboard that shows how much Actions and Codespaces usage an account has
Incorrect
Copilot helps you write code and complete tasks; it isn't a usage report.
CAn AI assistant that suggests code, answers questions and works on tasks
Correct
That is how GitHub describes Copilot.
DA cloud development environment
Incorrect
Copilot assists you inside your tools; it isn't the environment you code in.
GitHub Copilot is an AI assistant that helps you write, understand and ship software. It suggests code as you type, answers questions about a codebase, reviews your changes and works on tasks you assign it.
A developer changes her running codespace to a machine type with more cores. When does the new machine type take effect?
AAfter a stop and a restart
BImmediately, without interrupting her work
COnly after the repository is archived
DOnly after every collaborator approves the change
Show the answer and why
AAfter a stop and a restart
Correct
Changing the machine type needs a stop and restart.
BImmediately, without interrupting her work
Incorrect
The change needs a restart.
COnly after the repository is archived
Incorrect
Archiving has nothing to do with machine types.
DOnly after every collaborator approves the change
Incorrect
It is her own codespace's setting.
You can change the machine type of a codespace, for example to get more cores and memory. If you change it for a running codespace, you need to stop and restart the codespace for the change to take effect.
A student with a GitHub Free personal account wants to try GitHub Codespaces on her own repositories. What does she need to start?
AA GitHub Enterprise Cloud subscription
BA payment method, which must be added before any codespace can be created
CA self-hosted runner
DNothing extra: her plan includes a free monthly quota
Show the answer and why
AA GitHub Enterprise Cloud subscription
Incorrect
Personal accounts can use Codespaces without it.
BA payment method, which must be added before any codespace can be created
Incorrect
Payment details are needed only to go beyond the included usage.
CA self-hosted runner
Incorrect
Runners are for GitHub Actions.
DNothing extra: her plan includes a free monthly quota
Correct
Free and Pro personal accounts include free monthly usage.
All personal GitHub accounts have a monthly quota of free use of GitHub Codespaces included in the Free or Pro plan, so you can start without changing settings or providing payment details. To go beyond the included storage and compute, provide payment details and set a spending limit.