You have exactly one Windows x64 self-hosted runner, and it is configured with custom tools. Which syntax could you use in the workflow to target that runner?
Answer(s): A
Using self-hosted runners in a workflowTo use self-hosted runners in a workflow, you can use labels or groups to specify the runner for a job.Using default labels to route jobsA self-hosted runner automatically receives certain labels when it is added to GitHub Actions. These are used to indicate its operating system and hardware platform:self-hosted: Default label applied to self-hosted runners.linux, windows, or macOS: Applied depending on operating system.x64, ARM, or ARM64: Applied depending on hardware architecture.You can use your workflow's YAML to send jobs to a combination of these labels. In this example, a self-hosted runner that matches all three labels will be eligible to run the job:runs-on: [self-hosted, linux, ARM64]self-hosted - Run this job on a self-hosted runner.linux - Only use a Linux-based runner.ARM64 - Only use a runner based on ARM64 hardware.
https://docs.github.com/en/actions/how-tos/manage-runners/self-hosted-runners/use-in-a-workflow
As a developer, your Actions workflow often reuses the same outputs or downloaded dependencies from one run to another. To cache dependencies for a job, you are using the GitHub cache action. Which input parameters are required for this action? (Each correct answer presents part of the solution. Choose two.)
Answer(s): A,C
Input parameters for the cache action[C] key: Required The key created when saving a cache and the key used to search for a cache. It can be any combination of variables, context values, static strings, and functions. Keys have a maximum length of 512 characters, and keys longer than the maximum length will cause the action to fail.[A] path: Required The path(s) on the runner to cache or restore.Incorrect:restore-keys: Optional enableCrossOsArchive: Optional
https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching
As a developer, you need to use GitHub Actions to deploy a microservice that requires runtime access to a secure token. This token is used by a variety of other microservices managed by different teams in different repos. To minimize management overhead and ensure the token is secure, which mechanisms should you use to store and access the token? (Each correct answer presents a complete solution. Choose two.)
Answer(s): B,C
[B] Using a corporate secret store like HashiCorp Vault provides a secure, centralized location for sensitive information. GitHub Actions can then retrieve and store the token securely during deployment by setting it as an environment variable, ensuring the token remains secure and accessible at runtime.[C] Storing the token as an organizational-level encrypted secret in GitHub ensures it is accessible across multiple repositories, minimizing management overhead. GitHub Actions can then use this secret during deployment by setting it as an environment variable, allowing the microservice to access it securely at runtime.
What are two reasons to keep an action in its own repository instead of bundling it with other application code? (Each correct answer presents a complete solution. Choose two.)
Answer(s): B,D
Storing an action in its own repository makes it easier for the GitHub community to discover the action [B], narrows the scope [Not C] of the code base for developers fixing issues and extending the action, and decouples the action's versioning from the versioning of other application code [D].
https://docs.github.com/en/actions/how-tos/create-and-publish-actions/manage-custom-actions
As a DevOps engineer, you need to define a deployment workflow that runs after the build workflow has successfully completed. Without modifying the build workflow, which trigger should you define in the deployment workflow?
Answer(s): D
A deployment workflow can be started after a build workflow has finished by using the workflow_run event in the deployment workflow's on trigger. You must specify the name of the build workflow you want to trigger on and use an if condition to ensure the deployment workflow only runs if the build workflow successfully completes.Here's how to set it up:1. In your deployment workflow file: (e.g., deploy.yml), define the on: trigger.2. Use the workflow_run event: within the on: trigger.3. Specify the build workflow: by its name.4. Add a conditional if statement: to the workflow to check the conclusion of the workflow_run event, ensuring it equals 'success'.Example (deploy.yml):name: Deploy on:workflow_run:workflows: ["Build Workflow"] # Replace with the actual name of your build workflow types: [completed]branches: [ 'main' ] # Optional: Trigger only on the default branch jobs:deploy:runs-on: ubuntu-latest if: ${{ github.event.workflow_run.conclusion == 'success' }}steps:- name: Deploy to Production run: echo "Deploying..." # Add your actual deployment steps hereIncorrect:[Not B] workflow_dispatch is used to manually trigger workflows.
https://docs.github.com/actions/learn-github-actions/events-that-trigger-workflows
Post your Comments and Discuss Microsoft GH-200 exam prep with other Community members:
Our website is free, but we have to fight against AI bots and content theft. We're sorry for the inconvenience caused by these security measures. You can access the rest of the GH-200 content, but please register or login to continue.