How should you print a debug message in your workflow?
Answer(s): A
Example: Setting a debug message echo "::debug::Set the Octocat variable"
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands
As a developer, you are designing a workflow and need to communicate with the runner machine to set environment variables, output values used by other actions, add debug messages to the output logs, and other tasks. Which of the following options should you use?
Answer(s): E
Workflow commands for GitHub ActionsYou can use workflow commands when running shell commands in a workflow or in an action's code.About workflow commandsActions can communicate with the runner machine to set environment variables, output values used by other actions, add debug messages to the output logs, and other tasks.Most workflow commands use the echo command in a specific format, while others are invoked by writing to a file.
When should you use the GITHUB_TOKEN in a workflow?
Use GITHUB_TOKEN for authentication in workflowsAt the start of each workflow job, GitHub automatically creates a unique GITHUB_TOKEN secret to use in your workflow. You can use the GITHUB_TOKEN to authenticate in the workflow job.
https://docs.github.com/en/actions/tutorials/authenticate-with-github_token
In which of the following scenarios should you use self-hosted runners? (Each correct answer presents a complete solution. Choose two.)
Answer(s): B,C
[B] You can use self-hosted runner to run more than 6 hours job.Self-hosted runners give you the opportunity to persist whatever you like for your jobs and not be subject to the six-hour time-out in hosted virtual environments.[C] Give you more control of hardware, operating system, and software tools than GitHub-hosted runners provide.All runners can run Linux, Windows, or macOS.Incorrect:[Not A, not E]GitHub-hosted runners are fully managed on GitHub’s infrastructure using pre-configured Windows, Linux, and macOS virtual machines. In addition to offering standard runners for typical workloads, hosted runners offer larger runners with more resources (memory, CPU, and storage), custom images, static IP ranges, and Azure Virtual Network integration for enhanced security control.[Not D]GitHub Actions minutes refer to the amount of time your workflows, such as CI/CD pipelines, run on GitHub's hosted runners. Each time you trigger GitHub Actions (e.g., for testing, building, or deploying code), it consumes a portion of your available minutes.5 Dec 2024
https://github.com/orgs/community/discussions/26679https://docs.github.com/en/enterprise-cloud@latest/admin/managing-github-actions-for-your-enterprise/getting-started-with-github-actions-for-your-enterprise/getting-started-with-self-hosted-runners-for-your-enterprise https://docs.github.com/en/enterprise-cloud@latest/actions/concepts/runners/self-hosted-runners
As a developer, you need to leverage Redis in your workflow. What is the best way to use Redis on a self-hosted Linux runner without affecting future workflow runs?
Answer(s): C
Creating Redis service containersYou can use service containers to create a Redis client in your workflow. You can create a Redis service for jobs that run in containers or directly on the runner machine.Configuring the runner jobThe example uses the ubuntu-latest GitHub-hosted runner as the Docker host.The workflow configures a service container with the label redis.jobs:# Label of the runner job runner-job:# You must use a Linux environment when using service containers or container jobs runs-on: ubuntu-latest# Service containers to run with `runner-job`services:# Label used to access the service container redis:# Docker Hub image image: redis# Set health checks to wait until redis has started options: >---health-cmd "redis-cli ping"--health-interval 10s--health-timeout 5s--health-retries 5ports:# Maps port 6379 on service container to the host- 6379:6379
https://docs.github.com/en/actions/tutorials/use-containerized-services/create-redis-service-containers
Post your Comments and Discuss Microsoft GH-200 exam prep with other Community members: