GithubHelp home page GithubHelp logo

Comments (7)

stramel avatar stramel commented on September 1, 2024 1

Verified the changes worked on our setup. Thanks for the quick fix @jacobwgillespie!

from action.

stramel avatar stramel commented on September 1, 2024

Sorry, just saw that #71 is addressing this issue. Will keep this open until it is merged for other users to easily find the issue.

from action.

jacobwgillespie avatar jacobwgillespie commented on September 1, 2024

#71 has merged, this issue may be able to be closed.

from action.

ManasMaji avatar ManasMaji commented on September 1, 2024

Hi @stramel , @jacobwgillespie I am trying to setup a Github action using changesets to publish packages from a yarn + lerna managed mono-repo and I am facing a similar issue. I am not sure what I am doing wrong -

Run changesets/action@master
setting git user
/usr/bin/git config --global user.name "github-actions[bot]"
/usr/bin/git config --global user.email "github-actions[bot]@users.noreply.github.com"
setting GitHub credentials
/usr/bin/git checkout changeset-release/master
error: pathspec 'changeset-release/master' did not match any file(s) known to git
/usr/bin/git checkout -b changeset-release/master
Switched to a new branch 'changeset-release/master'
/usr/bin/git reset --hard 46ea8cef8ca27c82032e2e3659e04eaf5f0c054c
HEAD is now at 46ea8ce Revert changes made to publish workflow
Error: Cannot find module '@changesets/cli/package.json'
Require stack:
- /home/runner/work/aem-cloud-service-source-migration/aem-cloud-service-source-migration/noop.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at p (/home/runner/work/_actions/changesets/action/master/dist/index.js:906:437)
    at o (/home/runner/work/_actions/changesets/action/master/dist/index.js:906:546)
    at Object.module.exports [as default] (/home/runner/work/_actions/changesets/action/master/dist/index.js:906:574)
    at Object.b [as runVersion] (/home/runner/work/_actions/changesets/action/master/dist/index.js:908:3356)
    at async /home/runner/work/_actions/changesets/action/master/dist/index.js:910:1597 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/work/aem-cloud-service-source-migration/aem-cloud-service-source-migration/noop.js'
  ]
}
Error: Cannot find module '@changesets/cli/package.json'
Require stack:
- /home/runner/work/aem-cloud-service-source-migration/aem-cloud-service-source-migration/noop.js

This is my publish action workflow :

name: Publish Packages

on:
  push:
    branches:
      - master

jobs:
  publish-npm:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repo
        uses: actions/checkout@v2
        with:
          # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
          fetch-depth: 0

      - name: Setup Node.js 10.x
        uses: actions/setup-node@v1
        with:
          node-version: 10
          
      - name: Install Dependencies
        run: yarn

      - name: Execute Tests
        run: yarn test

      - name: Create Release Pull Request or Publish to npm
        id: changesets
        uses: changesets/action@master
        with:
          publish: yarn changeset publish
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

Any pointers would be immensely helpful.

from action.

jacobwgillespie avatar jacobwgillespie commented on September 1, 2024

Hey @ManasMaji, I took a look at the repo (I believe it's https://github.com/adobe/aem-cloud-service-source-migration) and I think the issue is that you don't have @changesets/cli installed in the root package.json.

This Changesets action here uses the locally installed version of @changesets/cli to perform actions on the repo during the CI workflow, but in your case the package is missing from your devDependencies here:

https://github.com/adobe/aem-cloud-service-source-migration/blob/46ea8cef8ca27c82032e2e3659e04eaf5f0c054c/package.json#L26-L34

Most likely running yarn install -W --dev @changesets/cli would resolve the error you're seeing.

from action.

Andarist avatar Andarist commented on September 1, 2024

Would throwing a custom error in such a case help? 🤔

from action.

ManasMaji avatar ManasMaji commented on September 1, 2024

Hi @jacobwgillespie , @Andarist Thank you so much for the quick help!! I really appreciate it! 🥇 👍
Indeed adding the @changesets/cli in the root package.json's devDependencies resolved the issue (a very bad oversight on my part).

from action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.