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?
Answer(s): B
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?
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.)
Answer(s): A,D
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.)
Answer(s): C,D
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.)
Answer(s): C,E
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.
Post your Comments and Discuss GitHub GitHub Actions exam prep with other Community members: