




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































GITHUB ACTIONS CERTIFICATION (GH-200) QUESTIONS WITH - VERIFIED ANSWERS- GRADED A+ || RECENTLY RELEASED Devops Engineers / Software Developers / Site Reliability Engineers Exam coverage:-
of the following correctly identifies the primary structural components of a GitHub Actions workflow file? A) Jobs, steps, and actions B) Events, jobs, and steps C) Triggers, runners, and artifacts D) Workflows, events, and runners CORRECT ANSWER : B) Events, jobs, and steps RATIONALE : A GitHub Actions workflow is defined by three primary structural components: Events (triggers that start the workflow), Jobs (sets of steps that execute on the same runner), and Steps (individual tasks within a job that can run commands or actions). While actions (A) are a key part of steps, they are not a top-level structural component. Runners (C, D) are the execution environments, not structural elements.
RATIONALE : The workflow_dispatch event allows a workflow to be triggered manually from the GitHub UI, GitHub CLI, or REST API. This is essential for manual testing or on-demand execution. push (A) is for code pushes, pull_request (B) is for pull request events, and schedule (D) is for cron-based triggers.
The cron key must be present. Option A is missing the cron key. Option B uses incorrect list syntax. Option C uses an invalid format for the cron expression.
C) Caching D) Secrets CORRECT ANSWER : C) Caching RATIONALE : The caching feature is specifically designed to store and reuse dependencies and other frequently used files between workflow runs. This significantly speeds up workflows by avoiding redundant downloads.
A) runs-on: self-hosted B) runs-on: [self-hosted, my-runner] C) runs-on: my-runner D) runs-on: [my-runner] CORRECT ANSWER : B) runs-on: [self-hosted, my-runner] RATIONALE : To target a specific self-hosted runner, you must include the self-hosted label along with the runner's custom label. The syntax is runs-on: [self-hosted, my-runner]. Using only my-runner (C) would not work because GitHub requires the self-hosted label to identify it as a self-hosted runner.
RATIONALE : On Linux and macOS runners, the default shell for run steps is Bash. On Windows runners, the default shell is PowerShell (A) or Cmd (C), depending on the context.
A) To store secrets B) To store environment variables that are accessible to all steps in a workflow C) To store outputs from a job D) To store GitHub API tokens CORRECT ANSWER : B) To store environment variables that are accessible to all steps in a workflow RATIONALE : The env context is used to define environment variables that are available to all steps in a workflow (or job, if defined at the job level). Secrets (A) are stored separately. Outputs (C) are for passing data between steps. Tokens (D) are typically stored as secrets.
matrix: node-version: [16, 18, 20] This creates three parallel jobs, each with a different node-version value.
A) if: github.repository_owner == 'owner' B) if: github.event.repository.fork == false C) if: github.actor == 'owner' D) if: github.ref == 'refs/heads/main' CORRECT ANSWER : B) if: github.event.repository.fork == false RATIONALE : The github.event.repository.fork context variable is true if the repository is a fork. Using if: github.event.repository.fork == false ensures the workflow only runs on the original (non-fork) repository.
A) types: [opened, synchronize] B) types: [opened, edited] C) types: [opened, reopened] D) types: [opened, closed] CORRECT ANSWER : A) types: [opened, synchronize] RATIONALE : The pull_request event allows filtering by activity types. opened triggers when a PR is created, and synchronize triggers when new commits are pushed to the PR branch. This is a common configuration for CI workflows.
RATIONALE : Setting continue-on-error: true on a step allows it to fail, but the job will continue to run subsequent steps. This is useful for non-critical steps where failure should not halt the entire workflow.