As a developer, you want to run a workflow from the Actions tab in GitHub. Which YAML snippet
should you use to match the interface in this image?
A)
B)
C)
D)
C
Explanation:
The first image shows a workflow trigger with an option for the test suite, and the chosen YAML
configuration matches this interface. Specifically, the test suite input is defined with type: choice and
includes the option value: functional, which aligns with the visible UI elements in the first image.
How many jobs will result from the following matrix configuration?
D
Explanation:
The matrix configuration specifies two variables: color and animal. The color variable has 2 values
(green and pink), and the animal variable has 2 values (owl and magpie). This would result in 4
combinations (2 color values × 2 animal values). Additionally, the include section introduces two
more combinations (color: blue and animal: owl; color: pink and animal: magpie).
As a developer, which workflow steps should you perform to publish an image to the GitHub
Container Registry? (Choose three.)
A, B, D
Explanation:
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.
As a developer, you have a 10-MB data set that is required in a specific workflow. Which steps should
you perform so the dataset is stored encrypted and can be decrypted during the workflow? (Choose
three.)
A, C, D
Explanation:
First, the dataset should be encrypted before being stored. This ensures that the data is protected
when stored in a repository.
The encrypted dataset can be stored in a GitHub secret, ensuring it is securely kept and not exposed
publicly.
The encryption key needed to decrypt the dataset should also be stored in a GitHub secret to
maintain security during the workflow, allowing access only when needed.
Which statement is true about using default environment variables?
D
Explanation:
GITHUB_WORKSPACE is a default environment variable in GitHub Actions that points to the directory
on the runner where your repository is checked out. This variable allows you to access files within
your repository during the workflow.
Which of the following commands will set the $FOO environment variable within a script, so that it
may be used in subsequent workflow job steps?
B
Explanation:
The $GITHUB_ENV environment variable is used to set environment variables that persist across
steps in a workflow job. By echoing FOO=bar into $GITHUB_ENV, the variable FOO will be available in
subsequent steps within the same job.
You are reaching your organization's storage limit for GitHub artifacts and packages. What should you
do to prevent the storage limit from being reached?
B
Explanation:
To prevent reaching the storage limit for GitHub artifacts and packages, you should manage and
clean up artifacts and packages stored in repositories owned by your organization. This includes
deleting unnecessary artifacts and managing the lifecycle of packages, as they contribute directly to
your organization's storage quota.
Based on the YAML below, which two statements are correct? (Choose two.)
A, D
Explanation:
The publish-npm job includes the JS-DevTools/npm-publish action, which is used to publish an npm
package to an npm registry.
The publish-npm job has the needs: build directive, meaning it will only run after the build job
successfully completes.
In which scenarios could the GITHUB_TOKEN be used? (Choose two.)
C, D
Explanation:
The GITHUB_TOKEN is automatically provided by GitHub in workflows and can be used to
authenticate API requests to GitHub, including publishing packages to GitHub Packages.
The GITHUB_TOKEN is also used to authenticate API requests for actions like creating issues,
commenting, or interacting with pull requests within the same repository.
As a developer, you need to use GitHub Actions to deploy a microservice that requires runtime
access to a secure token. This token is used by a variety of other microservices managed by different
teams in different repos. To minimize management overhead and ensure the token is secure, which
mechanisms should you use to store and access the token? (Choose two.)
C, E
Explanation:
Using a corporate secret store like HashiCorp Vault provides a secure, centralized location for
sensitive information. GitHub Actions can then retrieve and store the token securely during
deployment by setting it as an environment variable, ensuring the token remains secure and
accessible at runtime.
Storing the token as an organizational-level encrypted secret in GitHub ensures it is accessible across
multiple repositories, minimizing management overhead. GitHub Actions can then use this secret
during deployment by setting it as an environment variable, allowing the microservice to access it
securely at runtime.
What is the minimal syntax for declaring an output named foo for an action?
A)
B)
C)
D)
C
Explanation:
The correct minimal syntax for declaring an output in GitHub Actions is by using the foo key under
outputs, and associating it with a value (in this case, Some value). This is the simplest form to define
an output in a workflow or action.
When reviewing an action for use, what file defines its available inputs and outputs?
E
Explanation:
The action.yml file defines the inputs and outputs for a GitHub Action. This file contains metadata
about the action, including the required inputs and outputs, as well as other configurations like the
action's description, runs, and environment setup.
How should you install the bats NPM package in your workflow?
A)
B)
C)
D)
D
Explanation:
The correct syntax includes specifying the job (example-job), the runner (ubuntu-latest), and the
necessary step (npm install -g bats) within the workflow. This ensures that the package is installed
properly during the execution of the job.
How can GitHub Actions encrypted secrets be used in if: conditionals within a workflow job?
C
Explanation:
GitHub Actions encrypted secrets can be accessed in workflows using the secrets context. You can
directly reference the secret within an if: conditional using ${{ secrets.MySuperSecret }} to determine
whether a job or step should run based on the secret's value.
As a DevOps engineer, you are developing a container action. You need to execute a cleanup script
after completing the main script execution. Which code block should be used to define the cleanup
script?
A.
B.
C.
D.
A
Explanation:
The correct syntax for specifying a cleanup script to be run after the main entry point is executed in a
Docker-based GitHub Action is to use the post key. This ensures that cleanup.sh runs after the main
script (main.sh) has completed.