GitHub Actions Practice Test practice questions, page 2 of 4, with answer review and explanations.
Question 6
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?
run: echo "::set-env name=FOO::bar"
run: echo "FOO=bar" >> $GITHUB_ENV
run: echo ${{ $FOO=bar }}
run: export FOO=bar
Question 7
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?
via the .github repository owned by the organization
via repositories owned by the organization
via the GitHub Marketplace
via a repository owned by a third party
Question 8
As a developer, how can you identify a JavaScript action on GitHub?
The actions repository name includes the keyword "JavaScript."
The action's repository includes a js.yml file in the .github/workflows directory.
The action.yml metadata file references a package.json file.
The action,yml metadata file has the runs.using value set to node16.
Question 9
In which scenarios could the GITHUB_TOKEN be used? (Choose two.)
to leverage a self-hosted runner
to create a repository secret
to publish to GitHub Packages
to create issues in the repo
to read from the file system on the runner
to add a member to an organization
Question 10
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.)
Store the token in a configuration file in a private repository. Use GitHub Actions to deploy the configuration file to the runtime environment.
Store the token as a GitHub encrypted secret in the same repo as the code. Create a reusable custom GitHub Action to access the token by the microservice at runtime.
Use a corporate non-GitHub secret store (e.g., HashiCorp Vault) to store the token. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.
Store the token as a GitHub encrypted secret in the same repo as the code. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.
Store the token as an organizational-level encrypted secret in GitHub. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.