Which default environment variable specifies the branch or tag that triggered a workflow?
Answer(s): A
GITHUB_REF : The branch or tag ref that triggered the workflow.
https://graphite.dev/guides/github-actions-variables
As a DevOps engineer, you are developing a composite action. You have a step that needs to be executed against a subdirectory. Which code snippet should you use within the composite action to specify the directory?
Answer(s): C
To execute a specific step inside a composite action against a subdirectory relative to the action's location, you should use the working-directory property combined with the ${{ github.action_path }} context variable.Standard YAML Implementation runs:using: "composite"steps:- name: Run command in specific subdirectory run: npm install && npm run build shell: bash working-directory: ${{ github.action_path }}/your-subdirectory-name
https://www.meziantou.net/accessing-files-from-the-action-repository-in-a-github-composite-action.htm
What are the mandatory requirements for publishing GitHub Actions to the GitHub Marketplace? (Each correct answer presents part of the solution. Choose two.)
Answer(s): B,C
Publishing actions in GitHub MarketplaceYou can publish actions in GitHub Marketplace and share actions you've created with the GitHub community.Prerequisite include:[B] Each repository must contain a single action metadata file (action.yml or action.yaml) at the root.The name in the action's metadata file must be unique.The name cannot match an existing action name published on GitHub Marketplace.[C] The name cannot match a user or organization on GitHub, unless the user or organization owner is publishing the action. For example, only the GitHub organization can publish an action named github.Incorrect:[Not A] The action must be in a public repository.[Not D] The name cannot match an existing GitHub Marketplace category.
https://docs.github.com/en/actions/how-tos/create-and-publish-actions/publish-in-github-marketplace
You need to use a GitHub Actions step to create an output named version that has a value of 1.2.3.Which .shell command should you run?
Answer(s): B
$GITHUB_OUTPUT is the GitHub Actions environment file used to define step outputs. Appending version=1.2.3 creates an output named version with the value 1.2.3.
As a developer, you created a JavaScript action. What is the best way to test your JavaScript action?
Testing out your JavaScript action in a workflowYou can test your action out in a workflow.Public actions can be used by workflows in any repository. When an action is in a private repository, the repository settings dictate whether the action is available only within the same repository or also to other repositories owned by the same user or organization.
https://docs.github.com/en/actions/tutorials/create-actions/create-a-javascript-action
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.