Individual jobs (and therefore workflows) runs from scratch on some (usually) random worker node. This means that you can't pass any "content" apart from simple string/boolean values to another job or workflow. The jobs in the reusable workflow will need to checkout some repo or download/upload some other artifact because there is no shared workspace between jobs. Your job "call-reusable-workflow" cannot even have any directory or content to pass. The job just calls the reusable workflow and nothing else. Answer from SeniorIdiot on reddit.com
🌐
GitLab
docs.gitlab.com › cli
GitLab CLI (glab) | GitLab Docs
GLab is an open source GitLab CLI tool. It brings GitLab to your terminal, next to where you are already working with git and your code, without switching between windows and browser tabs.
Discussions

How to pass a folder via re-usable action workflow?
Individual jobs (and therefore workflows) runs from scratch on some (usually) random worker node. This means that you can't pass any "content" apart from simple string/boolean values to another job or workflow. The jobs in the reusable workflow will need to checkout some repo or download/upload some other artifact because there is no shared workspace between jobs. Your job "call-reusable-workflow" cannot even have any directory or content to pass. The job just calls the reusable workflow and nothing else. More on reddit.com
🌐 r/github
7
1
January 15, 2024
github - Running actions in another directory - Stack Overflow
There is an option to set a working-directory on a step, but not for multiple steps or a whole job. I'm fairly sure this option only works for script steps, not action steps with uses. https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun More on stackoverflow.com
🌐 stackoverflow.com
Option to specify working directory in GitHub Actions
GitHub allows specifying working-directory to run a step in a specific directory. I'm working in a large repo with lots of different directories - one of those directories is my typescript proj... More on github.com
🌐 github.com
5
February 22, 2023
GitHub actions (self-hosted) leaves behind working directories, how to not?
Expecting jobs to clean up after themselves is a losing battle. Ephemeral runners may be slightly slower to startup and fetch things but the time saved in debugging unreliable CI runners is worth it. Concentrate on building your software not on managing CI runners which is a solved problem. More on reddit.com
🌐 r/github
18
12
August 20, 2024
🌐
GitHub
docs.github.com › articles › getting-started-with-github-actions
Understanding GitHub Actions - GitHub Docs
Workflows are defined by a YAML ... manually, or at a defined schedule. Workflows are defined in the .github/workflows directory in a repository....
🌐
Kilo
kilo.ai › docs › code-with-ai › platforms › cli
Kilo CLI
Interactive mode is the default mode when running Kilo Code without the --auto flag, designed to work interactively with a user through the console. In interactive mode Kilo Code will request approval for operations which have not been auto-approved, allowing the user to review and approve operations before they are executed, and optionally add them to the auto-approval list. When running in interactive mode, command approval requests show hierarchical options: [!] Action Required: > ✓ Run Command (y) ✓ Always run git (1) ✓ Always run git status (2) ✓ Always run git status --short --branch (3) ✗ Reject (n)
🌐
Reddit
reddit.com › r/github › how to pass a folder via re-usable action workflow?
r/github on Reddit: How to pass a folder via re-usable action workflow?
January 15, 2024 -

Greetings! Trying to figure out if this is even possible, but I'm looking to standardize something via a re-usable workflow.

I would like to pass a directory with source code to a re-useable workflow. The re-useable workflow will then use that passed folder as the working directory:

Here is some dummy code to represent what I'm trying to do, see re-useable workflow.yml:

name: My Re-usable Workflow!

on:
  workflow_call:
    inputs:
     dir:
        required: true
        type: string

jobs:
  run-job:
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Test Hello World!
        working-directory: ${{ inputs.dir }}
        run: |
          chmod +x hello-world.sh
          ./hello-world.sh

Below is my original workflow that calls the re-usable one:

name: Original workflow calling re-useable one


jobs:
  call-reusable-workflow:
    uses: org/repo/.github/workflows/function1.yml@dev
    with:
      dir: /my-folder

My workflow above is essentially just passing the string /my-folder, but I would like to pass the entire directory. Inside /my-folder I have a hello world script just so I can test for functionality between passing a directory via workflow.

Would appreciate any guidance and if this is the way to proceed regarding my objective.

🌐
Git
git-scm.com › cheat-sheet
Git Cheat Sheet
The entire Pro Git book written by Scott Chacon and Ben Straub is available to read online for free. Dead tree versions are available on Amazon.com · Every time we say <commit>, you can use any of these:
Find elsewhere
Top answer
1 of 4
530

Update: It's now possible to set a working-directory default for a job. See this answer.

There is an option to set a working-directory on a step, but not for multiple steps or a whole job. I'm fairly sure this option only works for script steps, not action steps with uses.

https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun

Using working-directory, your workflow would look like this. It's still quite verbose but maybe a bit cleaner.

name: CI

on: [push]

jobs:
  phpunit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: Setup Symfony
        working-directory: ./app
        run: cp .env.dev .env
      - name: Install Composer Dependencies
        working-directory: ./app
        run: composer install --prefer-dist
      - name: Run Tests
        working-directory: ./app
        run: php bin/phpunit

Alternatively, you can run it all in one step so that you only need to specify working-directory once.

name: CI

on: [push]

jobs:
  phpunit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: Setup and run tests
        working-directory: ./app
        run: |
          cp .env.dev .env
          composer install --prefer-dist
          php bin/phpunit
2 of 4
419

You can now add a default working directory for all steps in a job: docs

For the example here, this would be:

name: CI

on: [push]

jobs:
  phpunit:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./app
    steps:
      - uses: actions/checkout@v1
      - name: Setup Symfony
        run: .env.dev .env
      - name: Install Composer Dependencies
        run: composer install --prefer-dist
      - name: Run Tests
        run: php bin/phpunit

Caveat: this only applies to run steps; eg you'll still need to add the subdirectory to with parameters of uses steps, if required.

🌐
DEV Community
dev.to › shofol › run-your-github-actions-jobs-from-a-specific-directory-1i9e
Run your Github Actions jobs from a specific directory - DEV Community
December 12, 2024 - jobs: job1: runs-on: ubuntu-latest defaults: run: working-directory: scripts ... Here is a simple Actions for NodeJs build job.
🌐
GitHub
docs.github.com › actions › using-workflows › workflow-syntax-for-github-actions
Workflow syntax for GitHub Actions - GitHub Docs
You must store workflow files in the .github/workflows directory of your repository. The name of the workflow. GitHub displays the names of your workflows under your repository's "Actions" tab.
🌐
BioErrorLog
en.bioerrorlog.work › top › github
Get the Absolute Path of the Default Working Directory in GitHub Actions - BioErrorLog Tech Blog
February 28, 2025 - - run: | echo $GITHUB_WORKSPACE # Example output # /home/runner/work/actions-tests/actions-tests · You can also get the same value from the workspace property of the github context. ... The default working directory on the runner for steps, and the default location of your repository when using the checkout action.
🌐
DEV Community
dev.to › jajera › understanding-github-actions-working-directory-550o
Understanding GitHub Actions Working Directory - DEV Community
January 7, 2025 - jobs: example-job: runs-on: ubuntu-latest defaults: run: working-directory: ./job-scripts steps: - name: Run job-level script run: ./script.sh · Effect: All run commands in the example-job will execute from the ./job-scripts directory. ... Effect: Only this specific step will execute from the ./step-scripts directory. GitHub Actions runners expose several environment variables that you can use to dynamically reference paths during workflows.
🌐
GitHub
github.com › changesets › action › issues › 265
Option to specify working directory in GitHub Actions · Issue #265 · changesets/action
February 22, 2023 - GitHub allows specifying working-directory to run a step in a specific directory. I'm working in a large repo with lots of different directories - one of those directories is my typescript project. .changesets is added in there at
Author   o-az
🌐
GitHub
github.com › orgs › community › discussions › 118464
Working directory path · community · Discussion #118464
For example, if you have a directory in your repository called repo, you would set the working directory like this: jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Run a multi-line script run: | echo Add your commands here echo Use a new line for each command working-directory: repo
🌐
Ryanbeckauthor
ryanbeckauthor.com › 2022 › 02 › 10 › A-Noob's-Guide-to-Github-Actions.html
A Noob's Guide to Github Actions
February 10, 2022 - Welcome to the website of science fiction writer Ryan Beck, author of SEER.
🌐
DEV Community
dev.to › nickytonline › git-worktrees-git-done-right-2p7f
Git Worktrees: Git Done Right - DEV Community
July 29, 2025 - Unfortunately, gh co doesn't support a --worktree flag at the moment, so I created a shell alias that combines the power of GitHub CLI with git worktrees: # cpr - create a git worktree for a pull request # Usage: cpr <PR_NUMBER> [<REMOTE>] # Example: cpr 1234 origin # If no remote is specified, it defaults to 'origin'. # Note: This command fetches the branch associated with the PR and creates a worktree in the current directory.
🌐
Software Testing Help
softwaretestinghelp.com › home › github › understanding github actions to automate workflows (with examples)
Understanding GitHub Actions to Automate Workflows (With Examples)
Example 1: From your repository on GitHub, create a new file in the .github/workflows directory named hello-world.yml · Copy the following YAML contents into the hello-world.yml file · name: hello-world on: push jobs: firstjob: runs-on: self-hosted steps: - name: Printing my name run: echo "Hi Niranjan, Welcome to GitHub Actions"
Published   April 1, 2025