GitHub Actions Questions

GitHub Actions

  1. Which statement is correct regarding passing permissions to reusable workflows?
  2. What are the different permission levels you can assign to `GITHUB_TOKEN` in the `permissions` block?
  3. You can use `permissions` to modify the `GITHUB_TOKEN` permissions on: (Select two.)
  4. Are GitHub Actions free for public repositories?
  5. Which of these is not a valid event that could trigger a workflow?
  6. Which is true about workflows? (Select three.)
  7. Which components are required for a workflow? (Select two.)
  8. Which event is triggered by a webhook action from outside of the repository?
  9. Workflows are defined in which format
  10. Where should you store sensitive data such as passwords or certificates that will be used in workflows
  11. In a workflow with multiple jobs the default behavior is:
  12. If job B requires job A to be finished you have to:
  13. In a workflow with multiple jobs, if job A fails then:
  14. This code will launch 6 different jobs in parallel using the matrix strategy. Can you use the matrix strategy to parallelize entire workflows?
  15. Which matrix job definition is syntactically correct?
  16. How do you access matrix variables in a matrix strategy job?
  17. When using the `pull_request` and `pull_request_target` events, how do you configure the workflow to run only when targeting the `prod` branch?
  18. This workflow will run on all pull requests where:
  19. Fill in the blank: When using `push` event trigger filters you can use <____> patterns to target multiple branches
  20. Which event allows you to manually trigger a workflow from the GitHub UI?
  21. What are the possible types of an input variable for a manually triggered workflow? (Select five.)
  22. A workflow that has only `workflow_dispatch` event trigger can be triggered using GitHub's REST API
  23. To stop a workflow from running temporarily without modifying the source code you should
  24. What are `activity types` of an event used for ?
  25. You want to create a reusable workflow `CI` that runs some quality checks, linting and tests on code changes. What event trigger should the `CI` workflow define to allow reusing it in other workflows?
  26. A reusable workflow named `build` creates zip file artifacts. How do you pass the zip file location to the caller workflow that is calling the `build` workflow? (Select three.)
  27. What are the valid use cases for using **defaults**? (Select two.)
  28. How can you ensure that a workflow called `Deploy Prod` is always running at most one at a time?
  29. Your Pull Request analysis workflow uses multiple code analysis tools and takes about 20minutes to fully complete. It is triggered on `pull_request` event with `branches` filter set to `master`. Therefore if a developer pushes multiple commits within few minutes multiple workflows are running in parallel. How can you stop all previous workflow runs and only run the one with latest changes?
  30. When will job3 run?
  31. What `jobs.job_id.if` conditional will make sure that job `production-deploy` is triggered only on `my-org/my-repo` repository? (Select two.)
  32. What GitHub-hosted runner types are available to use? (Select three.)
  33. Is this statement true? `Not all steps run actions, but all actions run as a step`
  34. For any action published in GitHub Marketplace, you can often use it in multiple versions, which approach is the most stable and secure?
  35. To prevent a job from failure when one of the steps fails you can include:
  36. You defined a matrix job `example_matrix`. How can limit the matrix to run a maximum of 2 jobs at a time?
  37. Which of these is a proper way of setting an output parameter `PET` with a value of `DOG` in a `step`.
  38. Which of these is a way of using `action_state` in `step_two`?
  39. Is this statement true? `Workflows can be reused, but a reusable workflow cannot call another reusable workflow.`
  40. In the following example, `workflow A` passes all of its secrets to `workflow B`, by using the inherit keyword. Then `workflow B` calls `workflow C`. Which statement regarding `secrets` is true for that example?
  41. When should you use `caching`?
  42. When should you use `artifacts`? (Select two.)
  43. If a workflow runs on a `feature-a` branch, can it restore `caches` created in the default `main` branch?
  44. To access an `artifact` that was created in another, previously triggered workflow run you can:
  45. What should you use to store coverage reports or screenshots generated during a workflow that runs automated testing for a repository?
  46. You can only upload a single file at a time when using `actions/upload-artifact` action
  47. In job `deploy`, if you want to access binaries (containing your application) that were created in job `build` you should
  48. A job called `job2` is using artifacts created in `job1`. Therefore it's important to make sure `job1` finishes before `job2` starts looking for the artifacts. How should you create that dependency?
  49. Which is true about `Starter Workflows` ? (Select three.)
  50. Secrets and configuration variables can be scoped to: (Select three.)
  51. What are the three types of Actions?
  52. Is this statement true? `Docker container actions are usually slower than JavaScript actions`
  53. When creating a custom GitHub Action you have to store the source code in `.github/workflows` directory
  54. When creating custom GitHub Actions - in what file does all the action `metadata` have to be defined?
  55. A workflow was initially run on `commit A` and failed. You fixed the workflow with the subsequent `commit B`. When you re-run that workflow it will run with code from which commit?
  56. How can you require manual approvals by a maintainer if the workflow run is targeting the `production` environment?
  57. Which is true about environments?
  58. When using GitHub Actions to access resources in one of the cloud providers (such as AWS, Azure or GCP) the safest and recommended way to authenticate is
  59. Your open-source publicly available repository contains a workflow with a `pull_request` event trigger. How can you require approvals for workflow runs triggered from forks of your repository?
  60. Which of the following default environment variables contains the name of the person or app that initiated the workflow run?
  61. Which of the following are default environment variables in GitHub Actions? (Select three.)
  62. Your organization defines a secret `SomeSecret`, however when you reference that secret in a workflow using `${{ secrets.SomeSecret }}` it provides a different value than expected. What may be the reason for that?
  63. Which is a correct way to print a debug message?
  64. How can organizations which are using GitHub Enterprise Server enable automatic syncing of third party GitHub Actions hosted on GitHub.com to their GitHub Enterprise Server instance?
  65. Where can you find network connectivity logs for a GitHub self-hosted-runner?
  66. How can you validate that your GitHub self-hosted-runner can access all required GitHub services?
  67. Which is the correct way of triggering a job only if configuration variable `MY_VAR` has the value of `MY_VALUE`?
  68. To run a `step` only if the secret `MY_SECRET` has been set, you can:
  69. How can you use the GitHub API to download workflow run logs?
  70. How can you use the GitHub API to create or update a repository secret?
  71. How can you override an organization-level GitHub Secret `API_KEY` with a different value when working within a repository? (Select two.)
  72. What components can be reused within a GitHub Organization? (Select four.)
  73. How many jobs will be executed in the following workflow?
  74. Which of the following default environment variables contains the full name (e.g `octocat/hello-world`) of the repository where the workflow is running?
  75. In a workflow that has multiple jobs, all running on GitHub-hosted runners, is it true that all jobs are guaranteed to run on the same runner machine?
  76. What's the maximum amount of reusable workflows that can be called from a single workflow file?
  77. What is a self-hosted runner?
  78. Which of the following is a correct statement about GitHub Workflows and Actions?
  79. On which commit and branch do scheduled workflows run in GitHub Actions?
  80. What is the correct syntax for setting the directory for all `run` commands in a workflow?
  81. How can you reuse a defined workflow in multiple repositories? (Choose two.)
  82. How can you ensure a job runs only on a specific branch?
  83. What does the `needs` keyword do in a GitHub Actions workflow?
  84. Which keyword allows you to define environment variables in a GitHub Actions workflow?
  85. What is the purpose of the `with` keyword in a GitHub Actions workflow?
  86. Which of the following GitHub Actions syntax is used to run multiple commands in a single step?
  87. How can you cache dependencies to speed up workflow execution?
  88. What does the `matrix` keyword do in a GitHub Actions workflow?
  89. Which of the following can be used to limit the number of concurrent jobs running in a GitHub Actions workflow?
  90. What is the default timeout for a GitHub Actions job?
  91. How can you specify the operating system for a job in GitHub Actions?
  92. In a GitHub Actions workflow, how do you specify a specific version of Node.js to use in a job?
  93. How do you reference a secret stored in GitHub Secrets in a workflow?
  94. What is the default shell used by GitHub Actions on Windows runners?
  95. Which of the following statements are true about adding a self-hosted runner in GitHub Actions? (Choose three.)
  96. Select the default environment variable that contains the operating system of the runner executing the job
  97. How does the `actions/cache` action in GitHub Actions handle a cache miss?
  98. How can you specify the schedule of a GitHub actions workflow to run on weekdays only?
  99. What is the recommended approach for storing secrets larger than 48 KB?
  100. Select status check functions in GitHub Actions
  101. How do you ensure that `Upload Failure test report` step is executed only if `Run Tests` step fails?
  102. Which context holds information about the event that triggered a workflow run?
  103. In GitHub Actions, if you define both branches and paths filter, what is the effect on the workflow execution?
  104. What is the recommended practice for treating environment variables in GitHub Actions, regardless of the operating system and shell used?
  105. Which of the following statements accurately describes the behavior of workflow jobs referencing an environment's protection rules?
  106. What is the purpose of the `restore-keys` parameter in `actions/cache` in GitHub Actions?
  107. Which variable would you set to `true` in order to enable step debug logging?
  108. Which configuration is appropriate for triggering a workflow to run on webhook events related to check_run actions?
  109. What is the purpose of the `timeout-minutes` keyword in a step?
  110. Dave is creating a templated workflow for his organization. Where must Dave store the workflow files and associated metadata files for the templated workflow?
  111. Dave wants to be notified when a comment is created on an issue within a GitHub repository. Which event trigger should be used within the workflow configuration?
  112. What level of access is required on a GitHub repository in order to delete log files from workflow runs?
  113. What is true about the following workflow configuration if triggered against the `octo/my-dev-repo` repository?
  114. How can you access the current values of variables in a matrix within a job in the example below:
  115. What level of permission is required to re-run the workflows
  116. When can you delete workflow runs? (select two)
  117. Who can bypass configured deployment protection rules to force deployment (by default)
  118. How can you skip the following workflow run when you commit or create a PR?
  119. How can you determine if an action is a container action by looking at its action.yml file?
  120. What is the correct syntax for specifying a cleanup script in a container action?
  121. What’s true about default variables? (choose three)
  122. What are the scopes defined for custom variables in a workflow? (choose three)