Which GitHub Actions command can mask sensitive data from appearing in logs?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerC
ExplanationThe ::add-mask:: workflow command hides sensitive values (such as passwords or tokens) from appearing in logs. Once masked, these values will be replaced with asterisks (***) to maintain confidentiality.
Which default GitHub environment variable indicates the name of the person or app that initiated a workflow?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerC
ExplanationThe GITHUB_ACTOR environment variable indicates the name of the person or app that initiated the workflow. This variable is automatically provided by GitHub in the workflow and can be used to identify the user or application triggering the workflow.
Question 3
Multiple choice
Based on the YAML below, which two statements are correct? (Choose two.) 
-
A
This workflow will publish a package to an npm registry.
-
B
This workflow will publish a package to GitHub Packages.
-
C
This workflow file is using a matrix strategy.
-
D
The workflow job publish-npm will only run after the build job passes.
Reveal answer details
Close answer details
Correct answersA, D
ExplanationThe 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.
Which GitHub Actions feature allows a workflow to be triggered by another workflow within the same repository?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerB
ExplanationThe workflow_run event enables a workflow to be triggered automatically after another workflow completes. This event type is useful for chaining workflows together, where one workflow performs testing and another performs deployment after successful completion.
Question 5
Multiple choice
GitHub-hosted runners support which capabilities? (Choose two.)
-
A
automatic patching of both the runner and the underlying OS
-
B
automatic file-system caching between workflow runs
-
C
support for Linux, Windows, and mac
-
D
support for a variety of Linux variations including CentOS, Fedora, and Debian
-
E
requiring a payment mechanism (e.g., credit card) to use for private repositories
Reveal answer details
Close answer details
Correct answersC, D
ExplanationGitHub-hosted runners automatically handle patching, meaning they will be kept up to date with the latest security updates and software patches for both the runner environment and the underlying operating system. GitHub-hosted runners support Linux, Windows, and macOS, giving you flexibility to run workflows on different operating systems without needing to manage your own self-hosted runners.
Which of the following is true about using strategy.fail-fast in a matrix job?
-
A
It allows failed jobs to automatically restart.
-
B
It stops all in-progress jobs if one matrix job fails.
-
C
It retries failed matrix combinations automatically.
-
D
It disables parallel job execution.
Reveal answer details
Close answer details
Correct answerB
ExplanationThe fail-fast option in a matrix strategy controls whether GitHub Actions cancels all other in-progress matrix jobs if one job fails. This saves compute time and resources during testing across multiple combinations.
Question 7
Multiple choice
Your organization needs to simplify reusing and maintaining automation in your GitHub Enterprise Cloud. Which components can be directly reused across all repositories in an organization? (Choose three.)
-
A
-
B
actions stored m private repositories in the organization
-
C
-
D
custom Docker actions stored in GitHub Container Registry
-
E
actions stored in an organizational partition in the GitHub Marketplace
-
F
Reveal answer details
Close answer details
Correct answersB, C, F
ExplanationActions stored in private repositories within the organization can be reused across all repositories by referencing them in workflows. This ensures a centralized way of maintaining custom actions. Encrypted secrets can be accessed across repositories in the same organization, making it easy to store sensitive data (like API keys or tokens) securely while allowing multiple workflows to access them. Workflow templates allow you to create reusable templates for workflows that can be shared across repositories within the organization. This makes it easier to standardize processes and automate them across multiple projects.
Question 8
Multiple choice
Which scopes are available to define custom environment variables within a workflow file? (Choose three.)
-
A
the entire workflow, by using env at the top level of the workflow file
-
B
all jobs being run on a single Actions runner, by using runner.env at the top of the workflow file
-
C
the entire stage, by using env at the top of the defined build stage
-
D
within the run attribute of a job step
-
E
the contents of a job within a workflow, by using jobs.<job_id>.env
-
F
a specific step within a job, by using jobs.<job_id>.steps[*].env
Reveal answer details
Close answer details
Correct answersA, D, F
ExplanationYou can define environment variables for the entire workflow by using the env key at the top level of the workflow file. These environment variables will be available to all jobs and steps within the workflow. Environment variables can also be set within the run attribute of a job step, and these variables will be scoped only to that specific step. You can set environment variables for specific steps within a job by using jobs.<job_id>.steps[*].env, which allows you to define variables that will only be available to that step.
Which syntax correctly accesses a job output (output1) of an upstream job (job1) from a dependent job within a workflow?
-
A
${{needs.job1.outputs.output1}}
-
B
-
C
${{depends.job1.output1}}
-
D
${{job1.outputs.output1}}
Reveal answer details
Close answer details
Correct answerA
ExplanationTheneedscontext is used to reference the outputs of jobs that are dependencies of the current job. In this case, needs.job1.outputs.output1correctly accesses the output ofoutput1from the jobjob1in the dependent job.
Question 10
Single choice
What will the output be for the following event trigger block in a workflow? 
-
A
It throws a workflow syntax error, pointing to the types definition in issue_comment event.
-
B
It throws a workflow syntax error, pointing to the types definition in issues event.
-
C
It runs the workflow when an issue is edited or when an issue comment created.
-
D
It runs the workflow when an issue or issue comment in the workflow's repository is created or modified.
-
E
It runs the workflow when an issue is created or edited, or when an issue or pull request comment is created.
Reveal answer details
Close answer details
Correct answerC
ExplanationThe provided event trigger block specifies two types of events: For issues: the workflow triggers on opened or edited issues. For issue_comment: the workflow triggers when an issue comment is created. This configuration ensures the workflow will run when either an issue is opened or edited, or an issue comment is created.
Question 11
Single choice
You have exactly one Windows x64 self-hosted runner, and it is configured with custom tools. Which syntax could you use in the workflow to target that runner?
-
A
self-hosted: [windows-x64]
-
B
runs-on: [self-hosted, windows, x64]
-
C
-
D
self-hosted: [windows, x64]
Reveal answer details
Close answer details
Correct answerB
ExplanationThe runs-on keyword allows you to specify the operating system and other labels for the runner. By specifying self-hosted, windows, and x64, you are targeting a self-hosted Windows runner that matches these criteria, which aligns with the custom configuration of your self-hosted runner.
Question 12
Single choice
What menu options in a repository do you need to select in order to use a starter workflow that is provided by your organization?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerD
ExplanationTo use a starter workflow provided by your organization, you need to go to the Actions tab in the repository and select New workflow. This option allows you to either create a new workflow or select from a list of available workflow templates, including starter workflows provided by your organization.
Question 13
Single choice
When using a Docker container action, what is the purpose of the post keyword in the action.yml file?
-
A
Defines a fallback Docker image.
-
B
Specifies cleanup steps that run after the main script.
-
C
Declares post-deployment configuration options.
-
D
Defines entrypoint arguments.
Reveal answer details
Close answer details
Correct answerB
ExplanationThe post key defines a script that executes after the main entrypoint script in a Docker container action. It's commonly used for cleanup operations, log collection, or resource deallocation once the main process completes.
|