0% found this document useful (0 votes)
32 views4 pages

QCM Mock Exam

devops

Uploaded by

karimmontassar6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views4 pages

QCM Mock Exam

devops

Uploaded by

karimmontassar6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

1/Which configuration is appropriate for triggering a workflow on a pull request?

​ A/ on:
​ pull_request:
​ branches:
​ - main
B/ on:
​ pull_request:
​ types:
​ - main
C/ on: push
D/ on: fork

2/You have created a secret named api_key to use in a workflow that deploys a new
application. Which of the following is the correct syntax to reference the secret as
an environment variable?
​ A/ steps:
​ - shell: bash
​ env:
​ ENV_API_KEY: ${{ secrets.environment.api_key }}
​ run: |
​ ./app_install.sh
​ B/ steps:
​ - shell: bash
​ with:
​ ENV_API_KEY = api_key
​ run: |
​ ./app_install.sh
​ C/ steps:
​ - shell: bash
​ with:
​ ENV_API_KEY: ${{ api_key }}
​ run: |
​ ./app_install.sh
​ D/ steps:
​ - shell: bash
​ env:
​ ENV_API_KEY: ${{ secrets.api_key }}
​ run: |
​ ./app_install.sh
3/You have developed a new GitHub Action and want to share it with the greater
community. Where should you publish it?
A/a public repository
B/a private repository
C/GitHub Marketplace
D/personal blog or website

4/ What will the value of the NAME variable be when this workflow is triggered?
​ name: CI
​ env:
​ NAME: 'My Action'
​ on:
​ push:
​ branches: [ "main" ]
​ jobs:
​ build:
​ env:
​ NAME: 'My Action 2'

​ runs-on: ubuntu-latest

​ - name: Print name
​ run: echo "$NAME"
​ env:
​ NAME: 'My Action 3'

A/ My Action
B/ My Action 3
C/ this run will error because of incorrect syntax
D/ My Action 2

5/ What is the purpose of the workflow_dispatch event?


A/ triggers the workflow when any branch is pushed
B/ enables manual triggering of the workflow
C/ initiates the workflow for pull requests
D/ runs the workflow on a predefined schedule
6/How many required inputs are declared in the metadata of this actions example?
​ inputs:
​ num-servers:
​ description: 'Number of Servers'
​ required: false
​ default: '3'
​ server-cpu-count:
​ description: 'CPU count of the Servers'
​ required: true

A/ 2
B/ 0
C/ 3
D/ 1

7/ What will be the result of running these tests?

function getUserName(user) {
return user?.name || 'Guest';
}
test('returns the user name when user is provided', () => {
expect(getUserName({ name: 'Alice' })).toBe('Alice');
});
test('returns "Guest" when user is null', () => {
expect(getUserName(null)).toBe('Guest');
});
test('returns "Guest" when user object has no name property', () => {
expect(getUserName({})).toBe('Guest');
});

A) All tests will pass.


B) The first test will pass, but the second and third tests will fail.
C) The first and second tests will pass, but the third test will fail.
D) The first and third tests will pass, but the second test will fail.

8/ What additional steps does GitHub add to each job in a workflow run?
A/ "Checkout" and "Post-job cleanup"
B/ “Set up job” and “Complete job”
C/ "Set up job" and "Tear down job"
D/ GitHub does not add any steps to a job. All steps must be configured in
the workflow file.

9/ You want to configure a GitHub Actions workflow to run only for specific activity
types triggered by a webhook event payload. Which keyword should you use in your
workflow configuration, and how can you restrict it to specific activity types?

A/use the ‘workflow’ keyword with a list of event names to include


B/use the ‘events’ keyword with a regex pattern to match specific event
names
C/use the ’on’ keyword with a conditional statement based on the event
payload
D/use the ‘types’ keyword with a list of specific activity types

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy