Free GH-200 Exam Braindumps
GitHub Actions Questions 26–30 (page: 7)

Updated On: 16-Nov-2026

While awaiting approval, how many days can a workflow be in the “Waiting” state before it automatically fails?

  1. 30 days
  2. 60 days
  3. 14 days
  4. 7 days

Answer(s): A

Explanation:

Using required reviews in workflows
Jobs that reference an environment configured with required reviewers will wait for an approval before starting.
While a job is awaiting approval, it has a status of "Waiting". If a job is not approved within 30 days, it will automatically fail.


Reference:

https://docs.github.com/en/actions/how-tos/deploy/configure-and-manage-deployments/control-deployments



As a developer, what is the safest way to reference an action to prevent modification of the underlying code?

  1. Use a commit hash.
  2. Use a branch name.
  3. Use a major release tag.
  4. Use a patch release tag.

Answer(s): A

Explanation:

The safest way to reference a GitHub Action to prevent any modification of its underlying code is to pin the action to a full-length, 40-character commit SHA (hash).Unlike tags or branch names, a commit SHA is strictly immutable in Git. This prevents malicious actors or developers from pushing silent updates, changing a release tag, or tampering with the code executing in your pipeline.
Secure Reference Syntax
When using a commit SHA, append a human-readable comment with the semantic version tag. This practice ensures your workflows remain easily auditable by your team.
steps:
- name: Checkout code uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1


Reference:

https://github.com/github/awesome-copilot/blob/main/instructions/github-actions-ci-cd-best-practices.instruction s.md



In which scenarios could the GITHUB_TOKEN be used? (Each correct answer presents a complete solution. Choose two.)

  1. to create a repository secret
  2. to add a member to an organization
  3. to read from the file system on the runner
  4. to publish to GitHub Packages
  5. to create issues in the repo
  6. to leverage a self-hosted runner

Answer(s): D,E

Explanation:

[D] To authenticate to a GitHub Packages registry within a GitHub Actions workflow, you can use:
*-> GITHUB_TOKEN to publish packages associated with the workflow repository.
* A personal access token (classic) with at least read:packages scope to install packages associated with other private repositories (GITHUB_TOKEN can be used if the repository is granted read access to the package.
[E] You can use the GITHUB_TOKEN to make authenticated API calls. This example workflow creates an issue using the GitHub REST API:
name: Create issue on commit on: [ push ]
jobs:
create_issue:
runs-on: ubuntu-latest permissions:
issues: write steps:
- name: Create issue using REST API
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/issues \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"title": "Automated issue for commit: ${{ github.sha }}",
"body": "This issue was automatically created by the GitHub Action workflow **${{ github.workflow }}**. \n\n The commit hash was: _${{ github.sha }}_."
}' \
--fail
Incorrect:
[Not A] The secrets API requires the secrets permission, which is not available in an Actions workflow via the GITHUB_TOKEN.
[Not B] The token cannot be given organization-scoped permissions. The scope is relatively limited.


Reference:

https://docs.github.com/en/packages/learn-github-packages/introduction-to-github-packages https://docs.github.com/en/actions/tutorials/authenticate-with-github_token



HOTSPOT (Drag and Drop is not supported)
You have a GitHub repository that contains a Node.js project and a local action named Action1. Multiple jobs in repository workflows call Action1. Action1 installs dependencies, runs tests, and returns a generated report path to the calling workflows.
You need to ensure that Action1 meets the following requirements:
● Encapsulates multiple workflow steps without packaging a separate runtime
● Exposes the report path produced by the test step
How should you complete the metadata file? To answer, select the appropriate options in the answer area.
Note: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: composite composite allows an action to execute multiple workflow steps without requiring a separate runtime or Docker container.
Box 2: ${{ steps.test.outputs.report-path }}
${{ steps.test.outputs.report-path }} retrieves the report-path output generated by the step with id: test. The test step writes the output to $GITHUB_OUTPUT, making it available to the calling workflow through the composite action's output mapping.



You are a developer working on developing reusable workflows for your organization.
What keyword should be included as part of the reusable workflow event triggers?

  1. pull_request
  2. check_run
  3. workflow_call
  4. workflow_run

Answer(s): C

Explanation:

To make a GitHub Actions workflow reusable, you must include the workflow_call keyword under the on key.
This specific event trigger allows the workflow to be called by other "caller" workflows rather than only triggering on standard events like a code push or pull request.
Reusable Workflow Syntax
A basic reusable workflow structure using the workflow_call trigger typically looks like this:
on:
workflow_call:
inputs:
# Optional: Define inputs to be passed from the caller username:
required: true type: string secrets:
# Optional: Define secrets to be passed from the caller env_token:
required: true
Key Components of workflow_call inputs: Used to define non-sensitive data (strings, numbers, or booleans) that the caller workflow must or can provide.
secrets: Used to define sensitive data that the caller must pass to the reusable workflow.
outputs: Used to map data from jobs within the reusable workflow so they can be used by the caller workflow.


Reference:

https://www.incredibuild.com/blog/best-practices-to-create-reusable-workflows-on-github-actions



Viewing page 7 of 28
Viewing questions 31 - 35 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!