Home Test Your Knowledge Github Actions Practice Exam

Github Actions Practice Exam

by Anup Maurya
16 minutes read

Prepare for GitHub Action Certifications with this Github Actions Practice Exam with more than 50+ question, that are similar to real exam.

Q1: Which matrix job definition is syntactically correct?

jobs:
 example_matrix:
   strategy:
     matrix:
       version: [10, 12, 14]
       os: [ubuntu-latest, windows-latest]
jobs:
 example_matrix:
   matrix:
     version: [10, 12, 14]
     os: [ubuntu-latest, windows-latest]
jobs:
 example_matrix:
   matrix:
     strategy:
       version: [10, 12, 14]
       os: [ubuntu-latest, windows-latest]
jobs:
 matrix:
   version: [10, 12, 14]
   os: [ubuntu-latest, windows-latest]

Q2: Which event is triggered by a webhook action from outside of the repository?

workflow_dispatch
webhook_dispatch
api_dispatch
repository_dispatch
remote_dispatch

Q3: Which keyword allows you to define environment variables in a GitHub Actions workflow?

vars
env
secrets
config

Q4: Your open-source publicly available repository contains a workflow with a pull_request event trigger. How can you require approvals for workflow runs triggered from forks of your repository?

The workflow will not trigger for forks if using pull_request event. If you want to do that you should use fork_pull_request event trigger with require-approval flag.
Setup deployment protection rules for the repository.
Setup branch protection rules for the repository.
Setup required approvals for fork runs in the repository

Q5: You defined a matrix job example_matrix. How can limit the matrix to run a maximum of 2 jobs at a time?

  jobs:
    example_matrix:
      strategy:
        matrix:
          version: [10, 12, 14]
          os: [ubuntu-latest, windows-latest]
Set jobs.example_matrix.strategy.concurrency to 2
It's not possible, a matrix will always run all of the jobs in parallel if there are runners available
Set jobs.example_matrix.strategy.max-parallel to 2
Use Github's REST API to check if the job count is lesser than 2

Q6: What is the default timeout for a GitHub Actions job?

360 minutes
30 minutes
60 minutes
120 minutes

Q7: Are Github Actions free for public repositories?

No
Yes

Q8: How can you override an organization-level GitHub Secret API_KEY with a different value when working within a repository? (Select two.)

By creating a repository secret with the name REPOSITORY_API_KEY
By creating a repository secret with the same name API_KEY
By creating a environment secret with the name ENVIRONMENT_API_KEY
By creating a environment secret with the same name API_KEY
By creating a repository secret with the name OVERRIDE_API_KEY
By creating a enterprise secret with the same name API_KEY
By creating a environment secret with the name OVERRIDE_API_KEY
By creating a enterprise secret with the name OVERRIDE_API_KEY

Q10: Which of the following are default environment variables in GitHub Actions? (Select three.)

GITHUB_WORKFLOW
GITHUB_USER
GITHUB_ORGANIZATION
GITHUB_TOKEN
GITHUB_REPOSITORY
GITHUB_ACTOR

Q11: How can organizations which are using GitHub Enterprise Server enable automatic syncing of third party GitHub Actions hosted on GitHub.com to their GitHub Enterprise Server instance?

GitHub Enterprise Server cannot use GitHub.com Actions because of it's on-premise nature and no internet access.
Using actions-sync tool
GitHub Enterprise Server has access to all GitHub.com Actions by default
Using GitHub Connect

related posts

Leave a Comment

Enable Notifications OK No thanks