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 20 minutes 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 all the action `metadata` has 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 can you call from a single workflow file?
  77. What is a self-hosted runner?