Free GH-200 Exam Braindumps
GitHub Actions Questions 56–60 (page: 13)

Updated On: 16-Nov-2026

Your organization has a secret that must be available to all the repositories within GitHub Actions workflows.
You need to store the secret. The solution must minimize administrative effort.
What should you do in GitHub?

  1. For each GitHub repository, select Settings > Secrets and variables > Actions, and then add the secret.
  2. From your personal GitHub profile, select Settings > Developer settings > Secrets, and then add the secret.
  3. From the organization's page, select Settings > Security > Secrets, and then add the secret.
  4. From the organization's page, select Settings > Secrets and variables > Actions, and then add the secret.

Answer(s): D

Explanation:

To store a secret securely while keeping administration low and making it available to all repositories, you must create a GitHub Organization Secret and set its visibility to "All repositories". This removes the administrative burden of manually creating and updating the secret across individual repositories.
Steps to Configure in the GitHub UI
Follow these steps to create an organization-level secret:
-> 1. Navigate to your GitHub Organization page.
2. Click on the Gear Settings tab in the top navigation bar.
-> 3. In the left sidebar, expand Secrets and variables and click Actions.
4. Click the New organization secret button.
5. Enter a Name and the Value for your secret.
6. Under Repository access, select All repositories.


Reference:

https://docs.github.com/actions/security-guides/using-secrets-in-github-actions



Which workflow commands send information from the runner? (Each correct answer presents a complete solution. Choose two.)

  1. reading from environment variables
  2. setting a debug message
  3. populating variables in a Dockerfile
  4. setting output parameters

Answer(s): B,D

Explanation:

[B] Setting a debug message
Prints a debug message to the log. You must create a secret named ACTIONS_STEP_DEBUG with the value true to see the debug messages set by this command in the log.
::debug::{message}
Example: Setting a debug message echo "::debug::Set the Octocat variable"
[D] Setting an output parameter
Sets a step's output parameter. Note that the step will need an id to be defined to later retrieve the output value.
echo "{name}={value}" >> "$GITHUB_OUTPUT"
Example of setting an output parameter
This example demonstrates how to set the SELECTED_COLOR output parameter and later retrieve it:
- name: Set color id: color-selector run: echo "SELECTED_COLOR=green" >> "$GITHUB_OUTPUT"
- name: Get color env:
SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }}
run: echo "The selected color is $SELECTED_COLOR"


Reference:

https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands



As a developer, which of the following snippets will enable you to run the commands npm ci and npm run build as part of a workflow?

  1. - run: |
    npm ci npm run build
  2. - shell:
    npm ci npm run build
  3. - run: |
    npm ci npm run build shell: nodejs
  4. - run:
    npm ci npm run build
  5. - shell: |
    npm ci npm run build

Answer(s): A

Explanation:

Use the run: keyword only, not the shell keyword.
Use the special character |.
Note: There are two ways to run commands one after another on Github Actions.
On the same step:
steps:
- name: Run both python files run: |
python manage.py runserver python abc.py
On different steps (that will run in sequence):
steps:
- name: Run first python file run: python manage.py runserver
- name: Run second python file run: python abc.py
Incorrect:
[Not B, Not E] Use run not shell.
[Not C] Use run only, not the shell command.
[Not D] Need to use the | character.


Reference:

https://stackoverflow.com/questions/71047777/how-to-run-two-commands-on-github-actions-instance-one-afte r-another



You need to make a script to retrieve workflow run logs via the API.
Which is the correct API to download a workflow run log?

  1. POST /repos/:owner/:repo/actions/runs/:run_id/logs
  2. GET /repos/:owner/:repo/actions/runs/:run_id/logs
  3. POST /repos/:owner/:repo/actions/runs/:run_id
  4. GET /repos/:owner/:repo/actions/artifacts/logs

Answer(s): B

Explanation:

REST API endpoints for workflow jobs
You can use the REST API to view logs and workflow jobs in GitHub Actions.
Download job logs for a workflow run
Gets a redirect URL to download a plain text file of logs for a workflow job.
Code samples for "Download job logs for a workflow run"
Request example
Get /repos/{owner}/{repo}/actions/jobs/{job_id}/logs


Reference:

https://docs.github.com/en/rest/actions/workflow-jobs



As a DevOps engineer, you need to execute a deployment to different environments like development and testing based on the labels added to a pull request. The deployment should use the releases branch and trigger only when there is a change in the files under ‘apps’ folder.
Which code block should be used to define the deployment workflow trigger?

  1. on:
    pull_request_label:
    branches:
    - 'releases'
    paths:
    - 'apps/**'
  2. on:
    pull_request:
    types: [labeled]
    branches:
    - 'releases/**'
    paths:
    - 'apps'
  3. on:
    pull_request:
    types: [labeled]
    branches:
    - 'releases'
    paths:
    - 'apps/**'
  4. on:
    pull_request_review:
    types: [labeled]
    branches:
    - 'releases'
    paths:
    - 'apps/**'

Answer(s): C

Explanation:

Incorrect:
[Not A] pull_request activitiy type labeled not specified.
pull_request_label is not a trigger.
[Not B] Specifies branches branches that has a name that starts with releases. We are only interested in the release branch.
branches:
- 'releases/**'
[Not C]
pull_request_review
Runs your workflow when a pull request review is submitted, edited, or dismissed. A pull request review is a group of pull request review comments in addition to a body comment and a state.


Reference:

https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows



Viewing page 13 of 28
Viewing questions 61 - 65 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!