Free GH-200 Exam Braindumps
GitHub Actions Questions 61–65 (page: 14)

Updated On: 16-Nov-2026

Which default environment variable specifies the branch or tag that triggered a workflow?

  1. GITHUB_REF
  2. GITHUB_BRANCH
  3. ENV_BRANCH
  4. GITHUB_TAG

Answer(s): A

Explanation:

GITHUB_REF : The branch or tag ref that triggered the workflow.


Reference:

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

Explanation:

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


Reference:

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.)

  1. The action can be either in a public or private repository.
  2. The action’s metadata file must be in the root directory of the repository.
  3. The action’s name cannot match a user or organization on GitHub unless the user or organization owner is publishing the action.
  4. The name should match with one of the existing GitHub Marketplace categories.
  5. Each repository can contain a collection of actions as long as they are under the same Marketplace category.

Answer(s): B,C

Explanation:

Publishing actions in GitHub Marketplace
You 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.


Reference:

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?

  1. echo ::set-output name=version::1.2.3
  2. echo "version=1.2.3" >> $GITHUB_OUTPUT
  3. echo 'VERSION=1.2.3' >> $GITHUB_PATH
  4. echo "version=1.2.3" >> $GITHUB_ENV

Answer(s): B

Explanation:

$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?

  1. Create a workflow that only executes your specific JavaScript action.
  2. Package your JavaScript action inside a docker container image and run it.
  3. Use a tool called @vercel/ncc to compile your code.
  4. Create a workflow that includes the actions/debug-javascript action.

Answer(s): A

Explanation:

Testing out your JavaScript action in a workflow
You 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.


Reference:

https://docs.github.com/en/actions/tutorials/create-actions/create-a-javascript-action



Viewing page 14 of 28
Viewing questions 66 - 70 out of 134 questions


Post your Comments and Discuss Microsoft GH-200 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!