As a DevOps engineer, you are developing a composite action. You have a step that needs to be executed against a subdirectory. Which code snippet should you use within the composite action to specify the directory?
For a run step in a composite action, GitHub Actions supports the working-directory property to specify the directory in which the command executes. The property belongs to the individual step, alongside properties such as run and shell. The generic keyword directory is not part of GitHub Actions metadata syntax. Composite actions declare runs.using: composite, after which runs.steps defines the reusable sequence of commands or actions. An input such as inputs.dir can therefore be referenced through an expression and assigned to working-directory. GitHub ' s action metadata reference explicitly defines runs.steps[*].working-directory as the supported property for controlling the execution directory of a composite-action command. Therefore, option B is the valid implementation.
================
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit