While awaiting approval, how many days can a workflow be in the ''Waiting'' state before it automatically fails?
Answer : C
When a workflow job targets an environment that has required reviewers, the job enters a waiting state until it is approved or rejected. GitHub Actions does not allow that waiting state to remain indefinitely. If the job is not approved within the allowed period, the workflow fails automatically. The correct duration is 30 days, making option C correct. Options A, B, and D do not match the GitHub Actions environment approval behavior. This is important for deployment governance because required reviewers can block access to protected environments and environment secrets, but pending approvals still have a maximum lifetime. This exam topic aligns with protected environments, deployment approvals, required reviewers, and workflow execution control.
================
Which of the following is the proper syntax to specify a custom environment variable named MY_VARIABLE with the value my-value?
A)
env: MY_VARIABLE = my-value
B)
environment: MY_VARIABLE = my-value
C)
env: MY_VARIABLE: my-value
D)
var: MY_VARIABLE: my-value
E)
var: MY_VARIABLE = my-value
F)
environment: MY_VARIABLE: my-value
Answer : C
You need to create a reusable GitHub Actions workflow template named ci.yml. The solution must ensure that ci.yml appears on the New workflow interface of GitHub Actions. Where should you store ci.yml?
Answer : C
Organization starter workflow templates must be stored in a special workflow template directory so that they appear in the GitHub Actions ''New workflow'' interface. The correct location is .github/workflow-templates, typically in the organization's .github repository. Therefore, option C is correct. Option A, .github/workflows, is where active workflow files are stored inside a repository so they can be triggered by events. It is not the correct location for organization-level starter templates. Option B is not a valid GitHub Actions workflow template directory. Option D is incorrect because storing the file in each repository's root does not publish it as a reusable starter workflow template. This checks workflow template reuse and organization automation standardization.
================
You are a DevOps engineer working on deployment workflows. You need to execute the deploy job only if the current branch name is feature-branch. Which code snippet will help you implement the conditional execution of the job?
A)
jobs: deploy: if: github.branch_name == 'feature-branch' runs-on: ubuntu-latest
B)
jobs: deploy: if: github.ref_name == 'feature-branch' runs-on: ubuntu-latest
C)
jobs: deploy: if: github.ref.name = 'feature-branch' runs-on: ubuntu-latest
D)
jobs: deploy: if: github.branch.name == 'feature-branch' runs-on: ubuntu-latest
Answer : B
As a developer, your Actions workflow often reuses the same outputs or downloaded dependencies from one run to another. To cache dependencies for a job, you are using the GitHub cache action. Which input parameters are required for this action? (Choose two.)
Answer : B, D
The key is required because it uniquely identifies the cache. It is used to store and retrieve cached data. When creating or restoring a cache, you need to define a key that will be used to identify the cache.
The path is the file path on the runner that you want to cache. This is where the cached files or dependencies are located and should be specified to tell GitHub where to store or retrieve the cache from.
As a developer, how can you identify a JavaScript action on GitHub?
Answer : D
A JavaScript action is identified in its action metadata file by the runs.using runtime value. In older exam-style content, this is commonly shown as node16; in current GitHub documentation, supported JavaScript runtimes have moved forward, but the principle remains the same: JavaScript actions declare a Node.js runtime under runs.using and specify the main JavaScript file under runs.main. Option A is not reliable because a repository can contain package.json without being a JavaScript action. Option B is unrelated because workflow files do not define the action type. Option C is naming-based and has no technical meaning. GitHub metadata syntax defines runs.using as the runtime for JavaScript actions.
You are a DevOps engineer working on deployment workflows. You need to execute the deploy job only if the current branch name is feature-branch. Which code snippet will help you to implement the conditional execution of the job?
Answer : A
The correct GitHub Actions context property for the short branch or tag name that triggered the workflow is github.ref_name. A job-level if: condition can use this context to control whether the job runs. Therefore, if: github.ref_name == 'feature-branch' correctly limits the deploy job to the feature-branch branch. The other options use invalid context paths such as github.ref.name, github.branch_name, and github.branch.name; these are not recognized GitHub Actions properties. In exam terms, this question validates knowledge of workflow expressions, GitHub context variables, and conditional job execution. The important distinction is that github.ref contains the full ref path, while github.ref_name provides the branch or tag name directly.
================