GitHub-Actions GitHub Actions Certificate Exam Practice Test

Page: 1 / 14
Total 72 questions
Question 1

As a developer, you need to create a custom action written in Python. Which action type should you choose?

As a developer, you need to create a custom action written in Python. Which action type should you choose?



Answer : D

A Docker container action is ideal for custom actions that require specific environments or dependencies, such as Python. By creating a Docker container, you can define the environment with the necessary Python version and dependencies, and your Python code can run inside that container.


Question 2

In which locations can actions be referenced by workflows? (Choose three.)



Answer : A, C, D

Actions can be stored in a separate public repository and referenced in workflows by specifying the repository and action name.

Actions can also be stored in the same repository as the workflow and referenced directly by their path (e.g., ./.github/actions/my-action).

Actions can be packaged as Docker container images and published to Docker Hub. These can then be referenced in workflows by specifying the Docker image.


Question 3

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.)



Answer : B, C, F

Actions 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 4

You installed specific software on a Linux self-hosted runner. You have users with workflows that need to be able to select the runner based on the identified custom software. Which steps should you perform to prepare the runner and your users to run these workflows? (Choose two.)



Answer : B, C

Once the runner is properly configured and labeled, users should be informed to select the specific runner by identifying the label or group name when defining the runner in their workflows.

Adding a custom label (like custom-software) to the runner makes it easier for users to select the runner in their workflows by using the runs-on key, which allows them to choose this specific runner based on its label.


Question 5

What are the two ways to pass data between jobs? (Choose two.)



Answer : E, F

Job outputs are used to pass data from one job to another in a workflow. A job can produce output values (like variables or files), which can be referenced by subsequent jobs using the needs keyword and ${{ steps.step_id.outputs.output_name }} syntax.

Artifact storage allows data (such as files or results) to be saved by a job and then retrieved by another job in a later step. This is commonly used for passing large amounts of data or files between jobs.


Question 6

You need to create new workflows to deploy to an unfamiliar cloud provider. What is the fastest and safest way to begin?



Answer : B

Searching the GitHub Marketplace for verified actions published by the cloud provider is the quickest and safest approach. Many cloud providers offer verified GitHub Actions that are maintained and optimized to interact with their services. These actions typically come with the correct configurations and best practices, allowing you to get started quickly without reinventing the wheel.


Question 7

Which choices represent best practices for publishing actions so that they can be consumed reliably? (Choose two.)



Answer : B, C

Using a tag is a best practice because tags are immutable and represent a fixed version of your action. By referencing tags, consumers of your action can be assured they are using a stable and specific version of the action, which helps in avoiding issues with breaking changes.

The commit SHA is another reliable way to specify a particular version of an action. By referencing a specific commit SHA, consumers can ensure they are using exactly the code that was written at that moment, avoiding the potential for changes in the future.


Page:    1 / 14   
Total 72 questions