Which of the following statements are true regarding the use of GitHub Actions on a GitHub Enterprise Server instance? (Each correct answer presents a complete solution. Choose three.)
Answer(s): B,C,F
[B] If you want your GitHub Enterprise Server instance to use third-party custom actions, you need to enable GitHub Connect.[C] Most official GitHub-authored actions are automatically bundled with GitHub Enterprise Server, and are captured at a point in time from GitHub Marketplace.[F] Third-party actions can be manually synchronized to GitHub Enterprise Server (GHES) to be used in workflows without requiring an internet connection to GitHub.com. This is done using the actions-sync tool to download actions from GitHub.com and transfer them to the GHES instance. This manual method provides an alternative to using GitHub Connect, offering stricter control over which actions are available on the GHES instance.Incorrect:[Not D] There is no connection required between your GitHub Enterprise Server instance and GitHub.com to use these actions.
https://docs.github.com/en/enterprise-server@3.17/get-started/exploring-integrations/about-using-integrations https://docs.github.com/en/enterprise-server@3.17/admin/managing-github-actions-for-your-enterprise/managi ng-access-to-actions-from-githubcom/about-using-actions-in-your-enterprise
You need to use a specific version of an action. How should you use v1 of an actions/javascript-action repository in your workflow?
Answer(s): D
The appropriate code to use version v1 of the actions/javascript-action repository in your GitHub Actions workflow is uses: actions/javascript-action@v1.Workflow ImplementationYou implement this code within a specific step under a job in your workflow YAML file (located in .github/workflows/):jobs:my_job:runs-on: ubuntu-latest steps:- name: Run JavaScript Action uses: actions/javascript-action@v1
https://docs.github.com/en/organizations/managing-organization-settings/disabling-or-limiting-github-actions-fo r-your-organization
What is a role of GitHub Marketplace when using GitHub Actions workflows?
Answer(s): B
The GitHub Marketplace is primarily a platform for finding and sharing public actions, apps, and workflows with the entire GitHub community.Incorrect:[Not C]The GitHub Marketplace is primarily a platform for finding and sharing public actions, apps, and workflows with the entire GitHub community. It is not the native platform for hosting workflows that are shared privately within an organization.How to Share Workflows PrivatelyRather than using the Marketplace, you can manage internal sharing through these methods:Internal Repositories: You can store reusable workflows or actions in an internal repository. This makes them visible and usable by any other repository within the same organization or enterprise without making them public.Private Repository Access: You can configure a private repository to allow access from other specific repositories or all repositories within your organization.Reusable Workflows: By defining a workflow with the on: workflow_call trigger, you can reference it from other repositories using the owner/repo/path/to/workflow.yml@ref syntax.Organizational Policies: Administrators can set policies at the organization or enterprise level to allow only internal actions, or a specific "allow list" of verified Marketplace actions.
https://www.geeksforgeeks.org/git/what-is-github-marketplace/
What is the proper syntax to reference the system-provided run number variable?
Default environment variablesThe default environment variables that GitHub sets are available to every step in a workflow.Because default environment variables are set by GitHub and not defined in a workflow, they are not accessible through the env context [Not B]. However, most of the default variables have a corresponding, and similarly named, context property. For example, the value of the GITHUB_REF variable can be read during workflow processing using the ${{ github.ref }} context property.
https://docs.github.com/en/actions/reference/workflows-and-actions/variables
Which workflow event is used to manually trigger a workflow run?
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
Share your comments for Microsoft GH-200 exam with other users:
Which statement is true about using default environment variables? The environment variables can be read in workflows using the ENV: variable_name syntax. The environment variables created should be prefixed with GITHUB_ to ensure they can be accessed in workflows The environment variables can be set in the defaults: sections of the workflow The GITHUB_WORKSPACE environment variable should be used to access files from within the runner.Correct answer: The statement "The GITHUB_WORKSPACE environment variable should be used to access files from within the runner." is true. Why the others are false:
${{ env.VARIABLE }}
$VARIABLE
GITHUB_
defaults:
run
GITHUB_WORKSPACE
${{ github.workspace }}
$GITHUB_WORKSPACE/...
${{ github.workspace }}/...
Keeping this site free takes real effort. We constantly battle automated scraping and unauthorized content copying. A quick account helps us protect the community and keep the site free.
To continue studying for your GH-200, please sign in or create a free account.