GitHub Foundations — Question 17

As a developer, you are authoring a workflow that will deploy to both DevCloud and TestCloud resources. Each cloud resource is accessed with a different deployment key. Which approach best allows you to use the same reusable workflow in separate jobs to target the different cloud resources?

Answer options

Correct answer: C

Explanation

Option C is correct because it allows the workflow to access the appropriate deployment key for each environment, ensuring a clean and reusable solution. Option A introduces unnecessary complexity with JSON objects, while Option B relies on additional parsing logic that is less straightforward. Option D requires separate naming conventions that could lead to confusion and increased maintenance overhead.