Get GitHub-Actions Actual Free Exam Q&As to Prepare for Your GitHub Certification
GitHub Actual Free Exam Questions And Answers
GitHub GitHub-Actions Exam Syllabus Topics:
| Topic | Details |
|---|---|
| Topic 1 |
|
| Topic 2 |
|
| Topic 3 |
|
| Topic 4 |
|
NEW QUESTION # 20
Which of the following is the best way for an enterprise to prevent certain marketplace actions from running?
- A. It is not possible; if an action is in the marketplace, its use cannot be restricted.
- B. Create a list of the actions that are allowed to run as an enterprise policy. Only these actions can be run.
- C. Create a list of the actions that are restricted from being used as an enterprise policy. Every other action can be run.
- D. Create a list that is maintained as a . yml file in a . github repository specified in the enterprise. Only these actions can be run.
Answer: B
Explanation:
The best way for an enterprise to control which GitHub Actions run is by creating a list of approved actions as an enterprise policy. This approach restricts workflows to only use the actions that are explicitly allowed, ensuring security and compliance within the organization.
NEW QUESTION # 21
Which syntax correctly accesses a job output (output1) of an upstream job (job1) from a dependent job within a workflow?
- A. ${{job1.outputs.output1}}
- B. ${{needs.job1.output1}}
- C. ${{needs.job1.outputs.output1}}
- D. ${{depends.job1.output1}}
Answer: C
Explanation:
Theneedscontext 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.
NEW QUESTION # 22
Scheduled workflows run on the:
- A. latest commit on the default or base branch
- B. latest commit and branch on which the workflow was triggered,
- C. specified commit and branch from the workflow YAML file,
- D. latest commit from the branch named main,
- E. latest commit from the branch named schedule,
Answer: B
Explanation:
Scheduled workflows in GitHub Actions are triggered at specified times, and they run on the latest commit of the branch that triggers the workflow. This means the workflow will run on the most recent commit on the branch that was active at the time the scheduled event occurs.
NEW QUESTION # 23
Disabling a workflow allows you to stop a workflow from being triggered without having to delete the file from the repo. In which scenarios would temporarily disabling a workflow be most useful? (Choose two.)
- A. A workflow sends requests to a service that is down.
- B. A runner needs to have diagnostic logging enabled.
- C. A workflow is configured to run on self-hosted runners
- D. A workflow needs to be changed from running on a schedule to a manual trigger
- E. A workflow error produces too many, or wrong, requests, impacting external services negatively.
Answer: A,E
Explanation:
If a workflow depends on an external service that is down, disabling the workflow temporarily will prevent it from running and sending requests to the service, thus avoiding failed requests or unnecessary retries.
If a workflow is causing a negative impact on external services by generating too many requests or incorrect data due to a bug, temporarily disabling the workflow will stop this behavior while the issue is fixed.
NEW QUESTION # 24
GitHub-hosted runners support which capabilities? (Choose two.)
- A. support for a variety of Linux variations including CentOS, Fedora, and Debian
- B. requiring a payment mechanism (e.g., credit card) to use for private repositories
- C. support for Linux, Windows, and mac
- D. automatic file-system caching between workflow runs
- E. automatic patching of both the runner and the underlying OS
Answer: A,C
Explanation:
GitHub-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.
NEW QUESTION # 25
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. runs-on: [self-hosted, windows, x64]
- B. self-hosted: [windows, x64]
- C. runs-on: windows-latest
- D. self-hosted: [windows-x64]
Answer: A
Explanation:
The 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.
NEW QUESTION # 26
Which action type should be used to bundle a series of run steps into a reusable custom action?
- A. Bash script action
- B. JavaScript action
- C. Docker container action
- D. Composite action
Answer: D
Explanation:
A composite action allows you to bundle multiple steps into a single reusable action within a workflow. It is composed of multiple run steps or other actions and can be reused across workflows, making it the perfect choice for bundling a series of steps.
NEW QUESTION # 27
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. Actions > New workflow
- B. Workflow > Load workflow
- C. Workflow > New workflow
- D. Actions > Load workflow
Answer: A
Explanation:
To 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.
NEW QUESTION # 28
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.)
- A. Store the encryption keys in a GitHub encrypted secret.
- B. Encrypt the dataset.
- C. Leverage the actions/download-secret action in the workflow.
- D. Store the dataset in a GitHub encrypted secret.
- E. Create a GitHub encrypted secret with the Large object option selected and upload the dataset.
- F. Commit the encrypted dataset to the same repository as the workflow
- G. Compress the dataset
Answer: A,B,D
Explanation:
First, the dataset should be encrypted before being stored. This ensures that the data is protected when stored in a repository.
The encrypted dataset can be stored in a GitHub secret, ensuring it is securely kept and not exposed publicly.
The encryption key needed to decrypt the dataset should also be stored in a GitHub secret to maintain security during the workflow, allowing access only when needed.
NEW QUESTION # 29
What are the advantages of using a matrix strategy in a job definition? (Choose two.)
- A. It can test code in multiple operating systems.
- B. It can run up to 512 jobs per workflow run.
- C. It can test code in multiple versions of a programming language.
- D. It can decrease the costs for running multiple combinations of programming language/operating systems.
Answer: A,C
Explanation:
A matrix strategy allows you to define different versions of a programming language (or any other environment setting) and run tests on each version simultaneously. This is particularly useful for testing code compatibility across different versions of a language.
A matrix strategy can also be used to test code on multiple operating systems (e.g., Windows, macOS, Linux) by defining these operating systems as matrix variables. This enables cross-platform testing within the same workflow.
NEW QUESTION # 30
Which default environment variable specifies the branch or tag that triggered a workflow?
- A. GITHUB_BRANCH
- B. GITHUB_TAG
- C. GITHUB_REF
- D. ENV_BRANCH
Answer: C
Explanation:
The GITHUB_REF environment variable specifies the branch or tag that triggered the workflow. It contains the full reference to the branch or tag, such as refs/heads/main for a branch or refs/tags/v1.0 for a tag.
NEW QUESTION # 31
Which statement is true about using default environment variables?
- A. The environment variables can be set in the defaults: sections of the workflow
- B. The GITHUB_WORKSPACE environment variable should be used to access files from within the runner.
- C. The environment variables can be read in workflows using the ENV: variable_name syntax.
- D. The environment variables created should be prefixed with GITHUB_ to ensure they can be accessed in workflows
Answer: B
Explanation:
GITHUB_WORKSPACE is a default environment variable in GitHub Actions that points to the directory on the runner where your repository is checked out. This variable allows you to access files within your repository during the workflow.
NEW QUESTION # 32
You are a developer working on developing reusable workflows for your organization. What keyword should be included as part of the reusable workflow event triggers?
- A. check_run
- B. workflow_run
- C. workflow_call
- D. pull_request
Answer: C
Explanation:
The workflow_call event is used to trigger a reusable workflow from another workflow. This allows you to create workflows that can be reused in multiple places within your organization, enabling better modularity and reducing duplication.
NEW QUESTION # 33
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?
- A. Docker container action
- B. Python action
- C. JavaScript action
- D. composite run step
Answer: A
Explanation:
ADocker container actionis 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.
NEW QUESTION # 34
How can GitHub Actions encrypted secrets be used in if: conditionals within a workflow job?
- A. Use the secrets context within the conditional statement, e.g. ${{ secrets.MySuperSecret }}.
- B. Use a workflow command to expose the encrypted secret via a step's output parameter and then use the step output in the job's if: conditional.
- C. Set the encrypted secret as a job-level environment variable and then reference the environment variable within the conditional statement.
- D. Create a job dependency that exposes the encrypted secret as a job output, which can then be leveraged in a subsequent dependent job.
Answer: A
Explanation:
GitHub Actions encrypted secrets can be accessed in workflows using thesecretscontext. You can directly reference the secret within anif:conditional using${{ secrets.MySuperSecret }}to determine whether a job or step should run based on the secret's value.
NEW QUESTION # 35
Which default GitHub environment variable indicates the owner and repository name?
- A. REPOSITORY NAME
- B. GITHUB REPOSITORY
- C. ENV REPOSITORY
- D. GITHUB WORKFLOW REPO
Answer: A
Explanation:
The GITHUB_REPOSITORY environment variable contains the owner and repository name in the format owner/repository. It is automatically provided by GitHub Actions and can be used to reference the repository in workflows.
NEW QUESTION # 36
Which files are required for a Docker container action in addition to the source code? (Choose two.)
- A. metadata.yml
- B. action.yml
- C. Actionfile
- D. Dockerfile
Answer: B,D
Explanation:
Dockerfile: TheDockerfileis required for Docker container actions. It defines the environment for the action, specifying the base image, dependencies, and any commands to set up the action's runtime inside the container.
action.yml: Theaction.ymlfile is required for all GitHub Actions, including Docker container actions. It contains metadata about the action, including the inputs, outputs, and the runtime environment (which in this case is Docker, defined underruns.using).
NEW QUESTION # 37
How should you install the bats NPM package in your workflow?
- A.

- B.

- C.

- D.

Answer: B
Explanation:
The correct syntax includes specifying the job (example-job), the runner (ubuntu-latest), and the necessary step (npm install -g bats) within the workflow. This ensures that the package is installed properly during the execution of the job.
NEW QUESTION # 38
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? (Choose two.)
- A. Use self-hosted runners for all workflow runs.
- B. Disable branch protections in the repository.
- C. Delete artifacts from the repositories manually
- D. Configure the artifact and log retention period.
- E. Configure the repo to use Git Large File Storage.
Answer: C,D
Explanation:
Deleting artifacts from repositories manually will free up storage space. Artifacts are typically stored for a limited time by default, but manual cleanup can help manage space.
Configuring the artifact and log retention period allows you to control how long artifacts and logs are retained in your repository. By shortening the retention period, you can prevent unnecessary accumulation of data and manage storage more effectively.
NEW QUESTION # 39
Which scopes are available to define custom environment variables within a workflow file? (Choose three.)
- A. the entire stage, by using env at the top of the defined build stage
- B. the contents of a job within a workflow, by using jobs.<job_id>.env
- C. a specific step within a job, by using jobs.<job_id>.steps[*].env
- D. all jobs being run on a single Actions runner, by using runner.env at the top of the workflow file
- E. the entire workflow, by using env at the top level of the workflow file
- F. within the run attribute of a job step
Answer: C,E,F
Explanation:
You 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.
NEW QUESTION # 40
What are the two ways to pass data between jobs? (Choose two.)
- A. Use the copy action with restore parameter to restore the data from the cache
- B. Use the copy action to save the data that should be passed in the artifacts folder.
- C. Use job outputs
- D. Use the copy action with cache parameter to cache the data
- E. Use data storage.
- F. Use artifact storage.
Answer: C,F
Explanation:
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 theneedskeyword 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.
NEW QUESTION # 41
Which choices represent best practices for publishing actions so that they can be consumed reliably? (Choose two.)
- A. repo name
- B. tag
- C. organization name
- D. default branch
- E. commit SHA
Answer: B,E
Explanation:
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.
NEW QUESTION # 42
As a developer, what options should you recommend to implement standards for automation reuse? (Choose two.)
- A. Create workflow templates and store them in the organization's .github repository.
- B. Create reusable actions and workflows that can be called from other workflows.
- C. Create a marketplace partition to publish reusable automation for the company.
- D. Store shared corporate actions in subfolders in a defined and documented internally accessible repository.
Answer: A,B
Explanation:
Creating workflow templates in the organization's .github repository allows the organization to standardize workflows and make them easily reusable across multiple repositories. This ensures consistency and simplifies maintenance.
Creating reusable actions and workflows that can be called from other workflows helps modularize and standardize automation tasks. These reusable components can be maintained centrally and called from different workflows across repositories.
NEW QUESTION # 43
As a developer, how can you identify a Docker container action on GitHub?
- A. The action's repository includes @actions/core in the root directory.
- B. The action.yml metadata file has the runs.using value set to Docker.
- C. The action.yml metadata file references a Dockerfile file.
- D. The action's repository name includes the keyword "Docker."
Answer: B
Explanation:
In a Docker container action, theaction.ymlfile includes theruns.usingfield, which is set todockerto specify that the action runs inside a Docker container. This is the key indicator that the action is a Docker container action.
NEW QUESTION # 44
Which of the following scenarios requires a developer to explicitly use the GITHUB_TOKEN or github.token secret within a workflow? (Choose two.)
- A. making an authenticated GitHub API request
- B. assigning non-default permissions to the GITHUB_TOKEN
- C. checking out source code with the actions/checkout@v3 action
- D. passing the GITHUB_TOKEN secret to an action that requires a token as an input
Answer: A,D
Explanation:
Some actions may require a GITHUB_TOKEN as an input to authenticate and perform specific tasks, such as creating issues, commenting on pull requests, or interacting with the GitHub API. In such cases, you would need to explicitly pass the token to the action.
When making an authenticated GitHub API request, the GITHUB_TOKEN is required to authenticate the request. This token is automatically provided by GitHub in the workflow, and it must be explicitly used when interacting with the GitHub API.
NEW QUESTION # 45
......
GitHub-Actions Questions Truly Valid For Your GitHub Exam: https://www.prepawaytest.com/GitHub/GitHub-Actions-practice-exam-dumps.html
GitHub-Actions Actual Questions - Instant Download Tests Free Updated Today!: https://drive.google.com/open?id=10Alv1oE16_mOpF6WyEBaqaRRkTMEDQvG