GH-200 Practice Test Questions

64 Questions


What can be used to set a failed status of an action from its code?


A. @actions/github toolkit


B. JavaScript dist/ folder


C. Dockerfile CMD


D. a non-zero exit code


E. output variable


F. composite run step





D.
  a non-zero exit code

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


A. Use a commit hash.


B. Use a branch name.


C. Use a patch release tag.


D. Use a major release tag.





A.
  Use a commit hash.

As a developer, you need to create a custom action written in Python. Which action type should you choose?

As a developer, you need to create a custom action written in Python. Which action type should you choose?


A. JavaScript action


B. composite run step


C. Python action


D. Docker container action





D.
  Docker container action

As a DevOps engineer, you are trying to leverage an organization secret in a repo. The value received in the workflow is not the same as that set in the secret. What is the most likely reason for the difference?


A. There is a different value specified at the rego level.


B. There is a different value specified at the workflow level.


C. The Codespace secret doesn't match the expected value.


D. The Encrypt Secret setting was not configured for the secret.


E. There is a different value specified at the enterprise level.





A.
  There is a different value specified at the rego level.

Which default GitHub environment variable indicates the owner and repository name?


A. REPOSITORY NAME


B. GITHUB REPOSITORY


C. ENV REPOSITORY


D. GITHUB WORKFLOW REPO





A.
  REPOSITORY NAME

Which workflow event is used to manually trigger a workflow run?


A. create


B. workflow_dispatch


C. workflow_run


D. status





B.
  workflow_dispatch

What are the two ways to pass data between jobs? (Choose two.)


A. Use the copy action with restore parameter to restore the data from the cache


B. Use the copy action to save the data that should be passed in the artifacts folder.


C. Use the copy action with cache parameter to cache the data


D. Use data storage.


E. Use job outputs


F. Use artifact storage.





E.
  Use job outputs

F.
  Use artifact storage.

Which of the following scenarios requires a developer to explicitly use the GITHUB_TOKEN or github.token secret within a workflow? (Choose two.)


A. passing the GITHUB_TOKEN secret to an action that requires a token as an input


B. making an authenticated GitHub API request


C. checking out source code with the actions/checkout@v3 action


D. assigning non-default permissions to the GITHUB_TOKEN





A.
  passing the GITHUB_TOKEN secret to an action that requires a token as an input

B.
  making an authenticated GitHub API request

As a developer, which workflow steps should you perform to publish an image to the GitHub Container Registry? (Choose three.)


A. Use the actions/setup-docker action


B. Authenticate to the GitHub Container Registry.


C. Build the container image.


D. Push the image to the GitHub Container Registry


E. Pull the image from the GitHub Container Registry





A.
  Use the actions/setup-docker action

B.
  Authenticate to the GitHub Container Registry.

D.
  Push the image to the GitHub Container Registry

Where should workflow files be stored to be triggered by events in a repository?


A. .github/workflows/


B. .github/actions/


C. Nowhere; they must be attached to an act on in the GitHub user interface


D. anywhere


E. .workflows/





A.
  .github/workflows/

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? (Choose three.)


A. Specific actions can individually be enabled for the organization, including version information.


B. GitHub-verified actions can be collectively enabled for use in the enterprise.


C. Actions can be restricted to only those available in the enterprise.


D. Actions created by GitHub are automatically enabled and cannot be disabled.


E. Individual third-party actions enabled with a specific tag will prevent updated versions of the action from introducing vulnerabilities.


F. Actions can be published to an internal marketplace





A.
  Specific actions can individually be enabled for the organization, including version information.

B.
  GitHub-verified actions can be collectively enabled for use in the enterprise.

F.
  Actions can be published to an internal marketplace

As a developer, your Actions workflow often reuses the same outputs or downloaded dependencies from one run to another. To cache dependencies for a job, you are using the GitHub cache action. Which input parameters are required for this action? (Choose two.)


A. dependency: the name and version of a package to cache or restore


B. key: the key created when saving a cache and the key used to search for a cache


C. cache-hit: the copy action key used with restore parameter to restore the data from the cache


D. path: the file path on the runner to cache or restore


E. ref: the ref name of the branch to access and restore a cache created


F. restore-keys: the copy action key used with cache parameter to cache the data





B.
  key: the key created when saving a cache and the key used to search for a cache

D.
  path: the file path on the runner to cache or restore


Page 1 out of 6 Pages