Which workflow event is used to manually trigger a workflow run?
Answer(s): B
Manually running a workflowWhen a workflow is configured to run on the workflow_dispatch event, you can run the workflow using the Actions tab on GitHub, GitHub CLI, or the REST API.Configuring a workflow to run manuallyTo run a workflow manually, the workflow must be configured to run on the workflow_dispatch event.To trigger the workflow_dispatch event, your workflow must be in the default branch.
https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow
Which choices represent best practices for publishing actions so that they can be consumed reliably? (Each correct answer presents a complete solution. Choose two.)
Answer(s): B,D
Security practices for writing workflows and using GitHub Actions features.You can help mitigate this risk by following these good practices:[B] Pin actions to a full-length commit SHAPinning an action to a full-length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. When selecting a SHA, you should verify it is from the action's repository and not a repository fork.[D] Pin actions to a tag only if you trust the creatorAlthough pinning to a commit SHA is the most secure option, specifying a tag is more convenient and is widely used. If you’d like to specify a tag, then be sure that you trust the action's creators. The ‘Verified creator’ badge on GitHub Marketplace is a useful signal, as it indicates that the action was written by a team whose identity has been verified by GitHub. Note that there is risk to this approach even if you trust the author, because a tag can be moved or deleted if a bad actor gains access to the repository storing the action.
https://docs.github.com/en/actions/reference/security/secure-use
As a developer, you need to integrate a GitHub Actions workflow with a third-party code quality provider that uses the Checks API. How should you trigger a follow-up workflow?
The check_run event is triggered when a check (such as a code quality check) completes, including when the status of a check changes. By adding this event as a trigger, you can initiate a follow-up workflow when the code quality integration finishes its checks.
https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows
Which statement accurately describes using labels to route GitHub Actions workflows to runners?
Answer(s): A
GitHub Actions routes jobs to specific runners by matching the labels defined in the workflow's runs-on key with the labels assigned to available runners. For a job to be assigned to a runner, that runner must possess all of the labels specified in the workflow's routing arrayStandard Label Matching LogicWhen you write a job, you define a target list of labels using the runs-on keyword.jobs:build:runs-on: [self-hosted, linux, gpu]steps:- run: echo "Running a GPU intensive task on Linux!"For this job to clear the queue, GitHub searches for an active runner where:It has the label self-hosted ANDIt has the label linux ANDIt has the label gpuIf a runner only has [self-hosted, linux], it will be ignored. The runner can possess extra labels not requested by the workflow, but it must strictly contain at least the exact subset you specified.
https://docs.github.com/enterprise-cloud@latest/actions/hosting-your-own-runners/managing-self-hosted-runn ers/using-self-hosted-runners-in-a-workflow
Which of the following is the lowest repository permission you need to have for downloading workflow artifacts?
Answer(s): E
Downloading workflow artifactsYou can download archived artifacts before they automatically expire.Who can use this feature?People who are signed into GitHub and have read access to a repository can download workflow artifacts.
https://docs.github.com/en/actions/how-tos/manage-workflow-runs/download-workflow-artifacts
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.