Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 5 MCQs Continuous Integration (CI) with GitHub Actions

INT332 — Devops Virtualization And Configuration Management 60 questions. Pick an option to check it.

Read the notes

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 Understanding workflow automation Easy

    What is the primary purpose of workflow automation in GitHub Actions?

  2. Question 2 of 60 workflow directory structure Easy

    In which directory must GitHub Actions workflow files be stored to be recognized by GitHub?

  3. Question 3 of 60 Key components: workflows Easy

    What file format is used to define GitHub Actions workflows?

  4. Question 4 of 60 Key components: jobs, steps, actions, runners Easy

    Which GitHub Actions component provides the virtual server environment where jobs are executed?

  5. Question 5 of 60 Workflow triggers: push, pull request, schedule, manual workflow Easy

    Which event keyword is used to allow a workflow to be triggered manually from the GitHub UI?

  6. Question 6 of 60 Jobs & matrix strategies Easy

    What is a matrix strategy used for in GitHub Actions?

  7. Question 7 of 60 Steps & shell commands Easy

    Which keyword is used inside a workflow step to execute a shell command?

  8. Question 8 of 60 Using marketplace actions Easy

    Where can developers browse and find pre-built actions created by the community?

  9. Question 9 of 60 Language-specific actions Easy

    Which widely used action sets up a Node.js environment in a workflow?

  10. Question 10 of 60 Using caching for faster builds Easy

    Why is caching used in GitHub Actions workflows?

  11. Question 11 of 60 Multi-job workflows Easy

    By default, how do multiple jobs in a single GitHub Actions workflow execute?

  12. Question 12 of 60 Runners: GitHub-hosted runners Easy

    What is a GitHub-hosted runner?

  13. Question 13 of 60 Runners:Self-hosted runners Easy

    What is a primary advantage of using a self-hosted runner over a GitHub-hosted runner?

  14. Question 14 of 60 Runner security & management Easy

    Why is it generally considered unsafe to use self-hosted runners on public repositories?

  15. Question 15 of 60 Docker & GitHub Actions: Building Docker images in CI Easy

    Which shell command is typically executed in a workflow step to build a Docker image?

  16. Question 16 of 60 Pushing to Docker Hub Easy

    What must be configured in GitHub before an Action can successfully push a new image to Docker Hub?

  17. Question 17 of 60 Pushing to GitHub Container Registry (GHCR) Easy

    What domain name is used to access the GitHub Container Registry (GHCR)?

  18. Question 18 of 60 Events, triggers Easy

    In GitHub Actions, what defines an 'event'?

  19. Question 19 of 60 Deploying to servers/cloud using Actions Easy

    How should sensitive information like cloud API keys and deployment passwords be managed in GitHub Actions?

  20. Question 20 of 60 Workflow triggers: push, pull request, schedule, manual workflow Easy

    Which trigger uses POSIX cron syntax to run a workflow at specific times?

  21. Question 21 of 60 Events, triggers, workflow directory structure Medium

    To ensure GitHub recognizes a YAML file as an Actions workflow, in which specific directory path relative to the repository root must it be placed?

  22. Question 22 of 60 Workflow triggers: push, pull request, schedule, manual workflow Medium

    Which event trigger should you configure in a GitHub Actions workflow to allow users to manually trigger the workflow from the GitHub Actions tab, optionally providing input parameters?

  23. Question 23 of 60 Jobs & matrix strategies Medium

    You need to test your Node.js application against Node versions 14, 16, and 18 on both ubuntu-latest and windows-latest. How many total job executions will a standard matrix strategy create for this configuration?

  24. Question 24 of 60 Multi-job workflows Medium

    In a multi-job workflow, Job B requires the output or successful completion of Job A before it can start. Which keyword is used in the configuration for Job B to enforce this dependency?

  25. Question 25 of 60 Using caching for faster builds Medium

    When using the actions/cache action to speed up builds by caching dependencies, which input parameter is mandatory to accurately determine if the cache needs to be invalidated or restored?

  26. Question 26 of 60 Steps & shell commands Medium

    If you want to execute a multi-line shell script within a single step in a GitHub Actions workflow, how should you format the run keyword in the YAML file?

  27. Question 27 of 60 Using marketplace actions Medium

    When referencing a third-party action from the GitHub Marketplace in your workflow, how do you pin the action to a specific immutable release to prevent breaking changes?

  28. Question 28 of 60 Runners:Self-hosted runners Medium

    What is a primary reason a DevOps team might choose to deploy a self-hosted runner instead of using a GitHub-hosted runner?

  29. Question 29 of 60 Runners: GitHub-hosted runners Medium

    Which of the following accurately describes the environment of a standard GitHub-hosted runner for Ubuntu?

  30. Question 30 of 60 Runner security & management Medium

    Why is it considered a severe security risk to attach a self-hosted runner to a public repository without specific safeguards?

  31. Question 31 of 60 Docker & GitHub Actions: Building Docker images in CI Medium

    When building a Docker image using GitHub Actions, which action is standardly used to set up Docker Buildx, allowing for advanced features like multi-platform builds?

  32. Question 32 of 60 Pushing to GitHub Container Registry (GHCR) Medium

    When authenticating a workflow to push a Docker image to the GitHub Container Registry (GHCR), which credential is automatically provided by GitHub Actions and recommended for use?

  33. Question 33 of 60 Deploying to servers/cloud using Actions Medium

    How should a DevOps engineer securely pass static cloud provider credentials (like AWS Access Keys) into a GitHub Actions deployment workflow?

  34. Question 34 of 60 Key components: jobs, steps, actions, runners Medium

    In the GitHub Actions hierarchy, what is the correct relationship between jobs, steps, and workflows?

  35. Question 35 of 60 Pushing to Docker Hub Medium

    Before using docker/build-push-action to push an image to Docker Hub, which step must be executed in the workflow?

  36. Question 36 of 60 Language-specific actions Medium

    When configuring a CI workflow for a Python application, what is the primary purpose of using the actions/setup-python action?

  37. Question 37 of 60 Workflow triggers: push, pull request, schedule, manual workflow Medium

    You want to run a workflow every day at midnight UTC using the schedule event. What is the correct cron syntax to define this trigger?

  38. Question 38 of 60 Deployments to servers/clouds Medium

    When deploying an application to an AWS server using GitHub Actions via OIDC (OpenID Connect), what is the main advantage over using long-lived IAM user credentials?

  39. Question 39 of 60 Key components: workflows Medium

    If you define environment variables at the root level of a workflow using the env: keyword, what is the scope of those variables?

  40. Question 40 of 60 Understanding workflow automation Medium

    Which of the following best describes the core purpose of a Continuous Integration (CI) workflow in GitHub Actions?

  41. Question 41 of 60 Jobs & matrix strategies Hard

    A developer configures a build matrix with 3 operating systems and 3 Node.js versions (9 jobs total). Job 2 fails after 30 seconds. What is the default behavior of the remaining running jobs in the matrix, and how can it be altered to allow independent completion?

  42. Question 42 of 60 Workflow triggers: push, pull request, schedule, manual workflow Hard

    You want a workflow to trigger on pushes to the main branch, EXCEPT when the changes are strictly within the docs/ directory. Which of the following YAML configurations achieves this without throwing a syntax or validation error?

  43. Question 43 of 60 Using caching for faster builds Hard

    When using the actions/cache action, what happens if there is a cache miss for the exact key, but a partial match exists in the restore-keys list?

  44. Question 44 of 60 Runner security & management Hard

    Why is it considered a severe security risk to use persistent self-hosted runners for public repositories that accept pull requests from forks?

  45. Question 45 of 60 Pushing to GitHub Container Registry (GHCR) Hard

    To successfully authenticate and push a Docker image to the GitHub Container Registry (ghcr.io) within a GitHub Actions workflow using the default GITHUB_TOKEN, which specific permission must be explicitly granted to the job?

  46. Question 46 of 60 Deploying to servers/cloud using Actions Hard

    A workflow contains a deployment job configured with environment: production. The production environment in GitHub is set to require a manual reviewer. What happens to the workflow execution while waiting for the reviewer's approval?

  47. Question 47 of 60 Multi-job workflows Hard

    Job A generates a dynamic version string and needs to pass it to Job B. How is this correctly achieved in GitHub Actions?

  48. Question 48 of 60 Deployments to servers/clouds Hard

    When configuring a workflow to deploy to AWS without storing long-lived IAM user credentials as GitHub Secrets, which mechanism should be utilized?

  49. Question 49 of 60 Steps & shell commands Hard

    In a bash shell step on an Ubuntu runner, what is the default behavior if a command within a multi-line script fails (returns a non-zero exit code) halfway through the step?

  50. Question 50 of 60 Events, triggers, workflow directory structure Hard

    A developer places a valid workflow file at .github/actions/deploy.yml. Upon pushing to the repository, the workflow does not trigger. What is the root cause?

  51. Question 51 of 60 Docker & GitHub Actions: Building Docker images in CI Hard

    When building Docker images in CI, optimizing build times is crucial. Using the docker/build-push-action, which caching strategy natively utilizes GitHub Actions' built-in Cache API to store and retrieve Docker layers?

  52. Question 52 of 60 Runners: GitHub-hosted runners Hard

    You are deploying an application from a GitHub-hosted runner to a corporate database that strictly requires IP whitelisting. Which statement accurately describes the limitation of standard GitHub-hosted runners in this scenario?

  53. Question 53 of 60 Events, triggers, workflow directory structure Hard

    A team wants Workflow B to automatically execute only after Workflow A has successfully completed, regardless of whether Workflow A was triggered via a push, schedule, or manual event. Which event trigger should be configured in Workflow B?

  54. Question 54 of 60 Workflow triggers: push, pull request, schedule, manual workflow Hard

    When a workflow is triggered by a pull_request event originating from a fork repository, which repository's commit and secrets are used for the workflow execution by default?

  55. Question 55 of 60 Language-specific actions Hard

    In a Node.js workflow using actions/setup-node@v3, how can you configure the action to automatically cache npm dependencies by analyzing the lockfile, thereby bypassing the need for a manual actions/cache step?

  56. Question 56 of 60 Using marketplace actions Hard

    To mitigate supply chain attacks when utilizing third-party actions from the GitHub Marketplace, what is the most secure method for referencing an action in a workflow file?

  57. Question 57 of 60 Pushing to Docker Hub Hard

    When configuring automated pushes to Docker Hub using the docker/login-action in a CI pipeline, why is it functionally critical and recommended to use Docker Personal Access Tokens (PATs) instead of the main account password?

  58. Question 58 of 60 Workflow triggers: push, pull request, schedule, manual workflow Hard

    You are defining a manual workflow using workflow_dispatch. You need to allow the user to select an environment (either dev, staging, or prod) from a dropdown menu. How is this defined in the workflow YAML?

  59. Question 59 of 60 Runners:Self-hosted runners Hard

    A team manages multiple self-hosted runners across different architectures and specialized hardware (e.g., GPUs). How can a specific workflow job strictly and explicitly target a self-hosted runner equipped with a GPU?

  60. Question 60 of 60 Deploying to servers/cloud using Actions Hard

    You have a deployment workflow triggered on every push to the main branch. If multiple developers merge PRs in rapid succession, you want to ensure only one deployment runs at a time and any pending deployments are canceled in favor of the latest push. Which configuration achieves this?

That's unit 5

Answer a few questions and your score shows up here.