2025 Easily pass GitHub-Actions Exam with our Dumps & PDF Test Engine
GitHub-Actions PDF Pass Leader, GitHub-Actions Latest Real Test
NEW QUESTION # 26
Which run: command will set a step's output?
- A. run: echo "::set-env name=MY OUTPUT::foo"
- B. run: export MY_OUTPUT=foo
- C. run: echo "MY_OUTPUT=foo" >> $GITHUB_OUTPUT
- D. run: echo ${{ $GITHUB_OUTPUT=foo }}
Answer: C
Explanation:
The $GITHUB_OUTPUT file is used to pass data from one step to another in GitHub Actions. The echo command appends the key-value pair to this file, which sets the output variable (MY_OUTPUT) for the current step.
NEW QUESTION # 27
As a developer, your self-hosted runner sometimes looses connection while running jobs. How should you troubleshoot the issue affecting your self-hosted runner?
- A. Locate the self-hosted runner in your repository's settings page and download its log archive.
- B. Set the DEBUG environment variable to true before starting the self-hosted runner to produce more verbose console output.
- C. Start the self-hosted runner with the --debug flag to produce more verbose console output.
- D. Access the self-hosted runner's installation directory and look for log files in the _diag folder.
Answer: D
Explanation:
When troubleshooting a self-hosted runner, you can access the_diagfolder located in the self-hosted runner's installation directory. This folder contains diagnostic logs that can help you identify the root cause of issues, such as connection problems.
NEW QUESTION # 28
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?
- A. via repositories owned by the organization
- B. via the GitHub Marketplace
- C. via the .github repository owned by the organization
- D. via a repository owned by a third party
Answer: A
Explanation:
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.
NEW QUESTION # 29
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. Python action
- B. JavaScript action
- C. Docker container action
- D. composite run step
Answer: C
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 # 30
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. Workflow > New workflow
- B. Actions > New workflow
- C. Workflow > Load workflow
- D. Actions > Load workflow
Answer: B
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 # 31
Which files are required for a Docker container action in addition to the source code? (Choose two.)
- A. Dockerfile
- B. Actionfile
- C. action.yml
- D. metadata.yml
Answer: A,C
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 # 32
What is the minimal syntax for declaring an output named foo for an action?
- A.

- B.

- C.

- D.

Answer: C
Explanation:
The correct minimal syntax for declaring an output in GitHub Actions is by using thefookey underoutputs, and associating it with avalue(in this case,Some value). This is the simplest form to define an output in a workflow or action.
NEW QUESTION # 33
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.)
- A. Store the token in a configuration file in a private repository. Use GitHub Actions to deploy the configuration file to the runtime environment.
- B. Store the token as a GitHub encrypted secret in the same repo as the code. Create a reusable custom GitHub Action to access the token by the microservice at runtime.
- C. Store the token as a GitHub encrypted secret in the same repo as the code. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.
- D. Store the token as an organizational-level encrypted secret in GitHub. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.
- E. Use a corporate non-GitHub secret store (e.g., HashiCorp Vault) to store the token. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.
Answer: D,E
Explanation:
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.
NEW QUESTION # 34
Where should workflow files be stored to be triggered by events in a repository?
- A. .workflows/
- B. anywhere
- C. .github/workflows/
- D. Nowhere; they must be attached to an act on in the GitHub user interface
- E. .github/actions/
Answer: C
Explanation:
Workflow files must be stored in the .github/workflows/ directory of the repository. This is the standard location for GitHub Actions workflow files, and workflows in this directory are automatically triggered by events defined in the file, such as pushes, pull requests, or other GitHub events.
NEW QUESTION # 35
You need to trigger a workflow using the GitHub API for activity that happens outside of GitHub. Which workflow event do you use?
- A. deployment
- B. repository_dispatch
- C. check_suite
- D. workflow_run
Answer: B
Explanation:
Therepository_dispatchevent allows you to trigger a workflow in response to external activity. It is commonly used when you need to trigger a workflow from outside GitHub, such as from another system or service, by sending a request to the GitHub API. This event provides flexibility to integrate with various external systems and trigger workflows in a GitHub repository.
NEW QUESTION # 36
What is the smallest scope for an environment variable?
- A. a job
- B. the workflow settings
- C. the workflow env mapping
- D. a step
Answer: D
Explanation:
The smallest scope for an environment variable is within astep. Environment variables defined within a step are only accessible to that particular step, which makes it the smallest scope for a variable in a GitHub Actions workflow.
NEW QUESTION # 37
What can be used to set a failed status of an action from its code?
- A. a non-zero exit code
- B. Dockerfile CMD
- C. @actions/github toolkit
- D. output variable
- E. composite run step
- F. JavaScript dist/ folder
Answer: A
Explanation:
A non-zero exit code is used to set the status of an action to "failed" in GitHub Actions. When the action's script or code exits with a non-zero status, it indicates failure, and GitHub will mark the action as failed.
NEW QUESTION # 38
Which of the following scenarios would require the use of self-hosted runners instead of GitHub-hosted runners?
- A. running more than the three concurrent workflows supported by GitHub-hosted runners
- B. performing builds on macOS
- C. using specialized hardware configurations required for workflows
- D. using Docker containers as part of the workflow
- E. exceeding 50,000 monthly minutes of build time
Answer: A,C
Explanation:
GitHub-hosted runners have a limit on the number of concurrent workflows (typically 20 for free-tier accounts and 5 for enterprise). If your organization needs to run more workflows simultaneously, you would need to use self-hosted runners to increase the available concurrency.
Self-hosted runners allow you to configure specialized hardware or software setups that are necessary for certain workflows. GitHub-hosted runners may not have access to custom hardware configurations like GPUs or other specialized resources, so self-hosted runners are required in such cases.
NEW QUESTION # 39
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. actions stored m private repositories in the organization
- B. custom Docker actions stored in GitHub Container Registry
- C. actions stored in an organizational partition in the GitHub Marketplace
- D. encrypted secrets
- E. self-hosted runners
- F. workflow templates
Answer: A,D,F
Explanation:
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.
NEW QUESTION # 40
Based on the YAML below, which two statements are correct? (Choose two.)
- A. This workflow file is using a matrix strategy.
- B. This workflow will publish a package to an npm registry.
- C. This workflow will publish a package to GitHub Packages.
- D. The workflow job publish-npm will only run after the build job passes.
Answer: B,D
Explanation:
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.
NEW QUESTION # 41
In which scenarios could the GITHUB_TOKEN be used? (Choose two.)
- A. to create issues in the repo
- B. to read from the file system on the runner
- C. to leverage a self-hosted runner
- D. to publish to GitHub Packages
- E. to create a repository secret
- F. to add a member to an organization
Answer: A,D
Explanation:
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.
NEW QUESTION # 42
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. ${{needs.job1.output1}}
- C. ${{job1.outputs.output1}}
- D. ${{depends.job1.output1}}
Answer: A
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 # 43
What is the right method to ensure users approve a workflow before the next step proceeds?
- A. granting users repository approval permissions
- B. grantingusers workflow approval permissions
- C. creating a branch protection rule and only allow certain users access
- D. adding users as required reviewers for an environment
Answer: D
Explanation:
GitHub Actions allows you to configure environment protection rules, where you can require specific users or teams to approve the deployment before the workflow proceeds to the next step. This ensures that the required reviewers approve the workflow before any sensitive actions (such as deployment) occur.
NEW QUESTION # 44
Without the need to use additional infrastructure, what is the simplest and most maintainable method for configuring a workflow job to provide access to an empty PostgreSQL database?
- A. Use service containers with a Postgres database from Docker hub.
- B. Run the actions/postgres action in a parallel job.
- C. It is currently impossible to access the database with GitHub Actions.
- D. Dynamically provision and deprovision an environment.
Answer: A
Explanation:
GitHub Actions supports the use of service containers, which allows you to spin up a PostgreSQL database (or any other service) in a Docker container during your workflow. You can pull a PostgreSQL image from Docker Hub, and the container will automatically be available to your workflow job. This method requires no additional infrastructure and is easy to configure and maintain, as you simply define the container in the workflow file.
NEW QUESTION # 45
As a DevOps engineer, you are trying to leverage an organization secret in a repo. The value received in the workflow is not the same as that set in the secret. What is the most likely reason for the difference?
- A. The Codespace secret doesn't match the expected value.
- B. There is a different value specified at the enterprise level.
- C. There is a different value specified at the rego level.
- D. There is a different value specified at the workflow level.
- E. The Encrypt Secret setting was not configured for the secret.
Answer: C
Explanation:
GitHub secrets are defined at different levels: organization, repository, and sometimes at the workflow level.
If a secret is defined at both the organization level and the repository level, the repository-level secret will take precedence. So, if the value of the secret differs between these levels, the workflow will use the value from the repository level instead of the organization level.
NEW QUESTION # 46
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. a specific step within a job, by using jobs.<job_id>.steps[*].env
- C. within the run attribute of a job step
- D. the entire stage, by using env at the top of the defined build stage
- E. the contents of a job within a workflow, by using jobs.<job_id>.env
- F. all jobs being run on a single Actions runner, by using runner.env at the top of the workflow file
Answer: A,B,C
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 # 47
What is the right method to ensure users approve a workflow before the next step proceeds?
- A. granting users repository approval permissions
- B. grantingusers workflow approval permissions
- C. creating a branch protection rule and only allow certain users access
- D. adding users as required reviewers for an environment
Answer: D
Explanation:
GitHub Actions allows you to configure environment protection rules, where you can require specific users or teams to approve the deployment before the workflow proceeds to the next step. This ensures that the required reviewers approve the workflow before any sensitive actions (such as deployment) occur.
NEW QUESTION # 48
A development team has been using a Powershell script to compile and package their solution using existing tools on a Linux VM, which has been configured as a self-hosted runner. They would like to use the script as- is in an automated workflow. Which of the following should they do to invoke their script within a workflow step?
- A. Run the pwsh2bash command to convert the script so it can be run on Linux.
- B. Use the YAML shell: pwsh in a run step.
- C. Configure a self-hosted runner on Windows with the requested tools.
- D. Use the actions/run-powershell action to invoke the script.
- E. Use the YAML powershell: step.
Answer: B
Explanation:
Since the self-hosted runner is configured on a Linux VM and the script is written in PowerShell, you can invoke the script using the pwsh (PowerShell Core) shell in a run step in the workflow. This ensures that the script runs as-is on the Linux runner, as PowerShell Core (pwsh) is cross-platform and supports Linux.
NEW QUESTION # 49
As a developer, you want to review the step that caused a workflow failure and the failed step's build logs.
First navigate to the main page of the repository on GitHub. Which section contains the step failure information?
- A. Insights
- B. Issues
- C. Pull requests
- D. Code
- E. Actions
Answer: E
Explanation:
The Actions tab on the main page of the repository is where you can find detailed information about the workflow runs, including step failures and build logs. You can review the status of each job and step within the workflow, see the failure messages, and access logs for debugging.
NEW QUESTION # 50
......
GitHub GitHub-Actions Exam Syllabus Topics:
| Topic | Details |
|---|---|
| Topic 1 |
|
| Topic 2 |
|
| Topic 3 |
|
| Topic 4 |
|
GitHub-Actions Dumps Ensure Your Passing: https://www.passcollection.com/GitHub-Actions_real-exams.html
Valid GitHub-Actions Test Answers & GitHub-Actions Exam PDF: https://drive.google.com/open?id=1piIubOSm1q1J6MsaWwHXacekuXrwojK9

