Skip to content

Option to specify working directory in GitHub Actions #265

Description

@o-az

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 <repo_root>/typescript/.changesets.

When I run CI, changesets action errors out cause it can't find .changesets:

Error: There is no .changeset directory in this project

Any advice on how to handle this?

Activity

  1. shkumbinhasani commented on Feb 22, 2023

    @shkumbinhasani

    I am facing the same issue currently

  2. naaish-adam commented on May 18, 2023

    @naaish-adam

    I think you can use the cwd option to do that.

  3. hunterwilhelm commented on May 20, 2023

    @hunterwilhelm

    Here's how to use it

    ...
          - name: Create Release Pull Request or Publish
            id: changesets
            uses: changesets/action@v1
            with:
              publish: npm run release
              cwd: "./src/your-folder"
            env:
              GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
              NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
    
  4. poteirard commented on Jan 5, 2024

    @poteirard

    When I set the cwd I get the following error:

    🦋 error Error: "rotten-rings-brush" changeset mentions a release for a package "@test/ui" but such a package could not be found.

    It's weird because locally it can find the package. So it must be something about the directory being used :/

  5. hariria commented on Sep 22, 2025

    @hariria

    I am also facing the same issue. The cwd option does NOT work.

    If i have a repo structured like

      .
      ├─ .github
      └─ typescript
         ├─ .changeset
         ├─ package.json
         ├─ turbo.json
         ├─ ...
         └─ packages
            └─ sdk
    

    the following fails to run

    - name: Create Release Pull Request or Publish to npm
            if: github.event_name != 'workflow_dispatch' || github.event.inputs.bump != 'experimental'
            id: changesets
            uses: changesets/action@v1
            with:
              publish: pnpm release
              # I also tried just "typescript" and it didn't work either
              cwd: ./typescript
            env:
              GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
              NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
              NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

    with error

    Error: Error: There is no .changeset directory in this project
    Error: There is no .changeset directory in this project
    
  6. bluwy commented on May 15, 2026

    @bluwy
    Member

    This seems to be fixed by #536

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions