What is the most suitable action type for a custom action written in TypeScript?
Answer(s): D
Example: Build your custom GitHub ActionTo build your action, run npm run bundle. This will compile the TypeScript code in the src/ directory and output the JavaScript code in the dist/ directory. The exact command for bundle is defined in the package.json file.Note: About custom actionsActions are individual tasks that you can combine to create jobs and customize your workflow. YTypes of actionYou can build Docker container, JavaScript, and composite actions.
https://victoronsoftware.com/posts/typescript-github-action/https://docs.github.com/en/actions/concepts/workflows-and-actions/custom-actions
As a developer, you need to make sure that only actions from trusted sources are available for use in your GitHub Enterprise Cloud organization. Which of the following statements are true? (Each correct answer presents a complete solution. Choose three.)
Answer(s): A,B,C
[A] Internal Actions MarketplaceThe reason for having an internal actions marketplace is to have a central location for all the actions that can be used inside our production organization. This is to prevent any actions from the public marketplace from being used in our production organization, without being checked for security risks first.[B] Allow Marketplace actions by verified creators: You can allow all GitHub Marketplace actions created by verified creators to be used by workflows. When GitHub has verified the creator of the action as a partner organization, the badge is displayed next to the action in GitHub Marketplace.[C] You can enable specific actions for the organization by identifying them and providing version control, ensuring only trusted versions are used in workflows.Incorrect:[Not F] Disabling or limiting GitHub Actions for your organizationYou can enable, disable, and limit GitHub Actions for an organization.
https://devopsjournal.io/blog/2021/10/14/GitHub-Actions-Internal-Marketplace https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-organization-settings/disabling-or-l imiting-github-actions-for-your-organization
Which of the following is the best way for an enterprise to prevent certain marketplace actions from running?
The best way for an enterprise to control which GitHub Actions run is by creating a list of approved actions as an enterprise policy. This approach restricts workflows to only use the actions that are explicitly allowed, ensuring security and compliance within the organization.Note: To allow a specific list of actions at the GitHub Enterprise level, an administrator must navigate to Enterprise > Policies > Actions and select "Allow select actions". Then, from the dropdown menus, they choose "Allow selected actions and reusable workflows" and add the desired actions to the allowed list using the format OWNER/REPOSITORY@TAG-OR-SHA. These actions can also include local actions, actions from specific organizations, or specific tags or commit SHAs.
https://docs.github.com/en/enterprise-cloud@latest/admin/enforcing-policies/enforcing-policies-for-your-enterpr ise/enforcing-policies-for-github-actions-in-your-enterprise
Which files are required for a Docker container action in addition to the source code? (Each correct answer presents a partial solution. Choose two.)
Answer(s): A,D
Creating a Docker container actionCreate a dockerfileDockerfile support for GitHub ActionsWhen creating a Dockerfile for a Docker container action, you should be aware of how some Docker instructions interact with GitHub Actions and an action's metadata file.Creating an action metadata fileCreate a new action.yml file.
https://docs.github.com/en/actions/tutorials/use-containerized-services/create-a-docker-container-action https://docs.github.com/en/actions/reference/workflows-and-actions/dockerfile-support
As a DevOps engineer, you are developing workflows to build an application. You have a requirement to create the build targeting multiple node versions. Which code block should you use to define the workflow?
Answer(s): A
Use keywords strategy and matrix in that order.Last line should be node-version: ${{ matrix.node-ver}}Incorrect:[Not B]Use keywords matrix and strategy separately, not matrix-strategy.[Not C] Wrong order of keywords strategy and matrix.[Not D] Last line should be node-version: ${{ matrix.node-ver}} not ${{ strategy.node-ver}}Note: Running variations of jobs in a workflowCreate a matrix to define variations for each job.A matrix strategy lets you use variables in a single job definition to automatically create multiple job runs that are based on the combinationsAdding a matrix strategy to your workflow jobUse jobs.<job_id>.strategy.matrix to define a matrix of different job configurations. Within your matrix, define one or more variables followed by an array of values. For example, the following matrix has a variable called version with the value [10, 12, 14] and a variable called os with the value [ubuntu-latest, windows-latest]:jobs:example_matrix:strategy:matrix:version: [10, 12, 14]os: [ubuntu-latest, windows-latest]Using contexts to create matricesTo create matrices with information about workflow runs, variables, runner environments, jobs, and steps, access contexts using the ${{ <context> }} expression syntax.{"event_type": "test","client_payload": {"versions": [12, 14, 16]}}on:repository_dispatch:types:- test jobs:example_matrix:runs-on: ubuntu-latest strategy:matrix:version: ${{ github.event.client_payload.versions }}steps:- uses: actions/setup-node@v4with:node-version: ${{ matrix.version }}
https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/run-job-variations
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.