Optimize Your CI/CD Pipeline
Get instant insights into your CI/CD performance and costs. Reduce build times by up to 45% and save on infrastructure costs.
45% Faster Builds
60% Cost Reduction
Introduction
The working directory plays an important role with GitHub Actions in placing your scripts and commands in the right position. By default, GitHub Actions works from the topmost level in your repository tree. You can define where the shell commands will execute by setting the working-directory
and giving good organization and structure to your workflows. This is beneficial for projects that might be sparsely complicated, like monorepos, which lead to many directories.
Steps we will cover in this article:
- Understanding
working-directory
- Setting the Defaults at the Job Level
- Overriding
working-directory
for Specific Steps - Setting
working-directory
at the Workflow Level