

GitHub Actions -(GH-200) Exam Questions
Total Questions
Last Updated
1st Try Guaranteed

Experts Verified
Question 1 Single Choice
How many jobs will be executed in the following workflow?
- jobs:
- matrix-job:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- animal: [cat, dog, bear]
- color: [black, brown]
- steps:
- - run: echo "Hello ${{ matrix.color }} ${{ matrix.animal }}"
Explanation

Click "Show Answer" to see the explanation here
The provided workflow defines a matrix strategy with two dimensions: animal and color. It lists three values for animal (cat, dog, bear) and two values for color (black, brown). The matrix strategy will generate a job for each combination of values from the specified dimensions. In this case, there are 3 values for animal and 2 values for color, resulting in 3 * 2 = 6 jobs. So, six jobs will be executed in this workflow, one for each combination of animal and color.
https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#using-a-matrix-strategy
Explanation
The provided workflow defines a matrix strategy with two dimensions: animal and color. It lists three values for animal (cat, dog, bear) and two values for color (black, brown). The matrix strategy will generate a job for each combination of values from the specified dimensions. In this case, there are 3 values for animal and 2 values for color, resulting in 3 * 2 = 6 jobs. So, six jobs will be executed in this workflow, one for each combination of animal and color.
https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#using-a-matrix-strategy
Question 2 Single Choice
You encounter an issue while executing a GitHub Actions workflow and need to print a debug message to the log for troubleshooting. How can you accomplish this?
Explanation

Click "Show Answer" to see the explanation here
In GitHub Actions, you can print debug messages to the workflow log using the echo command.
********************
WRONG ANSWERS:
logandlogsare not a valid way to print a debug message to the logs. You want to use theechocommand
Explanation
In GitHub Actions, you can print debug messages to the workflow log using the echo command.
********************
WRONG ANSWERS:
logandlogsare not a valid way to print a debug message to the logs. You want to use theechocommand
Question 3 Single Choice
Which YAML keyword is used to specify the events that should trigger a workflow?
Explanation

Click "Show Answer" to see the explanation here
The on keyword is used to specify the events that should trigger a workflow. It allows you to define the events, such as pushes, pull requests, or other GitHub activities, that should initiate the execution of the workflow
********************
WRONG ANSWERS:
There is no
triggerkeyword to specify the events that should trigger a workflowThe
eventkeyword is not used to trigger a workflowThe
workflowkeyword is used to define the entire GitHub Actions workflow, including jobs, steps, and their configurations
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
Explanation
The on keyword is used to specify the events that should trigger a workflow. It allows you to define the events, such as pushes, pull requests, or other GitHub activities, that should initiate the execution of the workflow
********************
WRONG ANSWERS:
There is no
triggerkeyword to specify the events that should trigger a workflowThe
eventkeyword is not used to trigger a workflowThe
workflowkeyword is used to define the entire GitHub Actions workflow, including jobs, steps, and their configurations
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
Question 4 Single Choice
How can the retention period for artifacts be customized?
Explanation

Click "Show Answer" to see the explanation here
Custom retention periods can be configured for individual artifacts using the actions/upload-artifact action in a workflow
********************
WRONG ANSWERS:
Retention periods can be customized; this is done by using ‘actions/upload-artifact’ action
Retention periods can be configured at the repository, organization, and enterprise levels
Custom retention periods need to be defined for individual artifacts; they are not automatically applied to all repositories
https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
Explanation
Custom retention periods can be configured for individual artifacts using the actions/upload-artifact action in a workflow
********************
WRONG ANSWERS:
Retention periods can be customized; this is done by using ‘actions/upload-artifact’ action
Retention periods can be configured at the repository, organization, and enterprise levels
Custom retention periods need to be defined for individual artifacts; they are not automatically applied to all repositories
https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
Question 5 Single Choice
You have developed a new GitHub Action and want to share it with the greater community. Where should you publish it?
Explanation

Click "Show Answer" to see the explanation here
The GitHub Marketplace provides a platform for developers to share and discover GitHub Actions, enabling users to find and incorporate pre-built actions into their workflows easily. Publishing your GitHub Action on the Marketplace allows it to reach a wider audience and be easily discovered by other GitHub users.
********************
WRONG ANSWERS:
Publishing your GitHub Action in a private repository would restrict its visibility to only those who have access to the repository. It would not be accessible to the broader community.
While you can publish your GitHub Action in a public repository, it may not be as discoverable or accessible to users as it would be on the GitHub Marketplace.
While you could promote your GitHub Action on your personal website or blog, this method may not reach as wide of an audience or be as convenient for users to discover and incorporate into their workflows compared to publishing it on the GitHub Marketplace.
https://docs.github.com/en/actions/creating-actions/publishing-actions-in-github-marketplace
Explanation
The GitHub Marketplace provides a platform for developers to share and discover GitHub Actions, enabling users to find and incorporate pre-built actions into their workflows easily. Publishing your GitHub Action on the Marketplace allows it to reach a wider audience and be easily discovered by other GitHub users.
********************
WRONG ANSWERS:
Publishing your GitHub Action in a private repository would restrict its visibility to only those who have access to the repository. It would not be accessible to the broader community.
While you can publish your GitHub Action in a public repository, it may not be as discoverable or accessible to users as it would be on the GitHub Marketplace.
While you could promote your GitHub Action on your personal website or blog, this method may not reach as wide of an audience or be as convenient for users to discover and incorporate into their workflows compared to publishing it on the GitHub Marketplace.
https://docs.github.com/en/actions/creating-actions/publishing-actions-in-github-marketplace
Question 6 Single Choice
What is the filename of the metadata file that defines the inputs, outputs, and runs configuration for your action?
Explanation

Click "Show Answer" to see the explanation here
All actions require a metadata file. The metadata filename must be either action.yml or action.yaml. The data in the metadata file defines the inputs, outputs, and runs configuration for your action.
******************
WRONG ANSWERS
GitHub uses YAML syntax for files in a variety of locations for different purposes, so it is not uncommon that there could be a number of different files within GitHub that have a .yaml or .yml file extension. The metadata file for an action must be called action.yml or action.yaml. Therefore workflow.yaml, config.yaml and requirements.yaml are all incorrect answers.
https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions
Explanation
All actions require a metadata file. The metadata filename must be either action.yml or action.yaml. The data in the metadata file defines the inputs, outputs, and runs configuration for your action.
******************
WRONG ANSWERS
GitHub uses YAML syntax for files in a variety of locations for different purposes, so it is not uncommon that there could be a number of different files within GitHub that have a .yaml or .yml file extension. The metadata file for an action must be called action.yml or action.yaml. Therefore workflow.yaml, config.yaml and requirements.yaml are all incorrect answers.
https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions
Question 7 Single Choice
Which configuration is appropriate for triggering a workflow on a pull request?
Explanation

Click "Show Answer" to see the explanation here
- on:
- pull_request:
- branches:
- - main
This configuration specifies the pull_request event and further filters it to only trigger the workflow when the pull request targets the main branch. This accurately defines the trigger condition for the workflow, ensuring that it runs specifically when a pull request is opened or updated for the main branch.
******************
WRONG ANSWERS:
The
typeskey should specify the types of pull request events to trigger the workflow, such as opened, synchronize, or closed. The value main does not represent a valid pull request event type.The configuration
on: pushis incorrect for triggering a workflow on pull requests. It's correct for triggering a workflow on push events, but not for pull requests.The configuration using
on: forkruns your workflow when someone forks a repository but does not trigger for pull requests.
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
https://docs.github.com/en/actions/using-workflows/triggering-a-workflow
Explanation
- on:
- pull_request:
- branches:
- - main
This configuration specifies the pull_request event and further filters it to only trigger the workflow when the pull request targets the main branch. This accurately defines the trigger condition for the workflow, ensuring that it runs specifically when a pull request is opened or updated for the main branch.
******************
WRONG ANSWERS:
The
typeskey should specify the types of pull request events to trigger the workflow, such as opened, synchronize, or closed. The value main does not represent a valid pull request event type.The configuration
on: pushis incorrect for triggering a workflow on pull requests. It's correct for triggering a workflow on push events, but not for pull requests.The configuration using
on: forkruns your workflow when someone forks a repository but does not trigger for pull requests.
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
https://docs.github.com/en/actions/using-workflows/triggering-a-workflow
Question 8 Multiple Choice
Which of the following events can trigger workflows? (select three)
Explanation

Click "Show Answer" to see the explanation here
You can trigger a workflow when an issue has been opened, edited, or milestoned.
- on:
- issues:
- types: [opened, edited, milestoned]
You can trigger a workflow when you push a commit or tag or when you create a repository from a template.
For example, you can run a workflow when the push event occurs.
- on: push
You can trigger a workflow when a discussion has been created, edited, or answered.
- on:
- discussion:
- types: [created, edited, answered]
*******************
WRONG ANSWERS:
Currently, GitHub Actions do not support the triggering of a workflow when a member is given permission to a GitHub repository.
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issues
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push
Explanation
You can trigger a workflow when an issue has been opened, edited, or milestoned.
- on:
- issues:
- types: [opened, edited, milestoned]
You can trigger a workflow when you push a commit or tag or when you create a repository from a template.
For example, you can run a workflow when the push event occurs.
- on: push
You can trigger a workflow when a discussion has been created, edited, or answered.
- on:
- discussion:
- types: [created, edited, answered]
*******************
WRONG ANSWERS:
Currently, GitHub Actions do not support the triggering of a workflow when a member is given permission to a GitHub repository.
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issues
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push
Question 9 Multiple Choice
For an action that was triggered on: pull request, where can you see the workflow run status? (select three)
Explanation

Click "Show Answer" to see the explanation here
You can view a GitHub Actions workflow run status for a pull request on the pull request before a merge, on the checks tab of the pull request and within the GitHub Actions tab of the repository.
******************
WRONG ANSWERS
The "Issues" tab is primarily for managing and tracking issues within the repository, such as bug reports, feature requests, and other tasks. It doesn't typically display workflow run status.
https://docs.github.com/en/actions/using-workflows/triggering-a-workflow
Explanation
You can view a GitHub Actions workflow run status for a pull request on the pull request before a merge, on the checks tab of the pull request and within the GitHub Actions tab of the repository.
******************
WRONG ANSWERS
The "Issues" tab is primarily for managing and tracking issues within the repository, such as bug reports, feature requests, and other tasks. It doesn't typically display workflow run status.
https://docs.github.com/en/actions/using-workflows/triggering-a-workflow
Question 10 Multiple Choice
GitHub Packages is compatible with the following package managers: (select three)
Explanation

Click "Show Answer" to see the explanation here
GitHub Packages has support for the following package registries:
JavaScript - Node package manager (npm)
Ruby - RubyGems package manager (gem)
Java - Apache Maven project management and comprehension tool (mvn)
Java - Gradle build automation tool for Java (gradle)
.NET - NuGet package management for .NET (dotnet)
N/A Docker container management
*******************
WRONG ANSWERS:
RPM - GitHub Packages does not support the RPM package manager commonly used in Linux distributions like Red Hat Enterprise Linux, CentOS, and Fedora.
Explanation
GitHub Packages has support for the following package registries:
JavaScript - Node package manager (npm)
Ruby - RubyGems package manager (gem)
Java - Apache Maven project management and comprehension tool (mvn)
Java - Gradle build automation tool for Java (gradle)
.NET - NuGet package management for .NET (dotnet)
N/A Docker container management
*******************
WRONG ANSWERS:
RPM - GitHub Packages does not support the RPM package manager commonly used in Linux distributions like Red Hat Enterprise Linux, CentOS, and Fedora.



