nerdexam
Microsoft

GH-200 · Question #7

How can a workflow deploy mitigate the risk of multiple workflow runs that are deploying to a single cloud environment simultaneously? (Each correct answer presents part of the solution. Choose two.)

The correct answer is C. Specify a target environment in the deploymentjob. D. Specify a concurrency scope in the workflow. To prevent multiple workflow runs from deploying to the same environment simultaneously, two complementary approaches work together. First, specifying a target environment in the deployment job (C) ties the job to a GitHub Environment, which enforces deployment protection rules…

Implement and manage GitHub Actions workflows

Question

How can a workflow deploy mitigate the risk of multiple workflow runs that are deploying to a single cloud environment simultaneously? (Each correct answer presents part of the solution. Choose two.)

Options

  • AReference the mutex in the task performing the deployment.
  • BSet the concurrency in the deploymentjob to 1.
  • CSpecify a target environment in the deploymentjob.
  • DSpecify a concurrency scope in the workflow.
  • EConfigure the mutex setting in the environment.
  • FPass the mutex into the deployment job.

How the community answered

(24 responses)
  • A
    8% (2)
  • B
    4% (1)
  • C
    83% (20)
  • E
    4% (1)

Explanation

To prevent multiple workflow runs from deploying to the same environment simultaneously, two complementary approaches work together. First, specifying a target environment in the deployment job (C) ties the job to a GitHub Environment, which enforces deployment protection rules and prevents parallel deployments to the same environment. Second, specifying a concurrency scope in the workflow (D) using the 'concurrency' key cancels or queues pending runs that share the same concurrency group, ensuring only one deployment proceeds at a time. Options A, B, E, and F reference 'mutex,' which is not a GitHub Actions concept for managing deployment concurrency.

Topics

#GitHub Actions#Concurrency Control#Deployment Workflows#Environments

Community Discussion

No community discussion yet for this question.

Full GH-200 Practice