Skip to content

How to configure this action when project is not in the root folder? #133

Description

@dmregister

The project using changeset is currently in a sub-directory and the action is failing due to process.cwd not being in the correct folder. Is there a way to configure this for this action?

Activity

  1. Andarist commented on Jan 11, 2022

    @Andarist
    Member

    I'm pretty sure that using our version and publish inputs with a script changing the working directory and invoking the appropriate Changesets command would do the trick.

    We potentially could also support a new cwd input if you'd like to implement such a feature - this didn't come up until now.

  2. dmregister commented on Jan 11, 2022

    @dmregister
    ContributorAuthor

    @Andarist I was able to get this working. The issue with using cd in the version script, is in the index.ts it calls readChangesetState, which uses process.cwd so it's before the version cmd. Changing the directory just for the node process also allows all the other default params using process.cwd() to be in the correct dir was well.

    I was hoping to write a test for this, but it seems there isn't anything setup for index.ts (without mocking everything). Is that correct?

  3. gyurielf commented on Jan 17, 2022

    @gyurielf

    @Andarist I was able to get this working. The issue with using cd in the version script, is in the index.ts it calls readChangesetState, which uses process.cwd so it's before the version cmd. Changing the directory just for the node process also allows all the other default params using process.cwd() to be in the correct dir was well.

    I was hoping to write a test for this, but it seems there isn't anything setup for index.ts (without mocking everything). Is that correct?

    Nice!
    It's a game changer feature! We can't wait for merge! :)

  4. dmregister commented on Jan 18, 2022

    @dmregister
    ContributorAuthor

    @gyurielf i've updated the README, is there something else that should be added as well?

  5. gyurielf commented on Jan 18, 2022

    @gyurielf

    I think it's should be fine, thank you!

    It would be nice if somebody can merge it.

  6. Andarist commented on Jan 23, 2022

    @Andarist
    Member

    I believe that this has been addressed by #134

  7. gyurielf commented on Jan 23, 2022

    @gyurielf

    I believe that this has been addressed by #134

    Cheers!

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