Review 99 GITHUB-ACTIONS practice questions with answer explanations and community insights.
Question 1
Which statement is true regarding the ability to delete a workflow run?
Pending workflow runs may be deleted.
Completed workflow runs may be deleted.
Admin access is required to delete a workflow run.
Workflow runs must be older than 30 days to be deleted.
Question 2
Which command can you include in your workflow file to set the output parameter for an action?
echo "::debug::action_color=purple"
echo "action_color=purple" >> $GITHUB_OUTPUT
echo "action_color=purple" >> $GITHUB_ENV
echo "::add-mask::$ACTION_COLOR"
Question 3
As a developer, which workflow steps should you perform to publish an image to the GitHub Container Registry? (Choose three.)
Use the actions/setup-docker action
Authenticate to the GitHub Container Registry.
Build the container image.
Push the image to the GitHub Container Registry
Pull the image from the GitHub Container Registry.
Question 4
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.)
Encrypt the dataset.
Leverage the actions/download-secret action in the workflow.
Store the dataset in a GitHub encrypted secret.
Store the encryption keys in a GitHub encrypted secret.
Compress the dataset
Commit the encrypted dataset to the same repository as the workflow
Create a GitHub encrypted secret with the Large object option selected and upload the dataset.
Question 5
Which statement is true about using default environment variables?
The environment variables can be read in workflows using the ENV: variable_name syntax.
The environment variables created should be prefixed with GITHUB_ to ensure they can be accessed in workflows
The environment variables can be set in the defaults: sections of the workflow
The GITHUB_WORKSPACE environment variable should be used to access files from within the runner.