TriPSs / conventional-changelog-action

Github Action that generates a changelog with the Conventional Changelog CLI
MIT License
285 stars 102 forks source link

Error: Unable to load the "eslint" preset. Please make sure it's installed. #265

Open emma-ong-maker opened 3 weeks ago

emma-ong-maker commented 3 weeks ago

Hi there, was wondering if anyone has encountered this and could shed some light on what I might be missing as a part of implementation?

image

When running as a github action, an error is thrown and it fails at this step given preset is set to eslint.

Please note if there are NO issues if preset is set to conventionalcommits, and this action runs successfully.

     # Bump version and push tag
      - name: Conventional Changelog Action
        id: changelog
        uses: TriPSs/conventional-changelog-action@v5.3.0
        with:
          github-token: ${{ secrets.ENZ_ADMIN_TOKEN }}
          # https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-eslint
          preset: 'eslint'
          output-file: 'CHANGELOG.md'

I have tried the following:

  1. Added the following prior to running the step name: Conventional Changelog Action, I have installed eslint and/or conventional-changelog-eslint as per readme under dev dependencies too

      # Setup Node.js environment
      - name: Set up Node.js
        uses: actions/setup-node@v2
        with:
          node-version: '18.18.0'
          registry-url: 'https://registry.yarnpkg.com/' # Use Yarn registry
    
      # Install dependencies using Yarn
      - run: yarn install
  2. Adding a eslint.config.mjs or eslint.config.js or .eslintrc.js`

Happy to provide more information if needed! Thank you

TriPSs commented 3 weeks ago

Could you try this with v4?

emma-ong-maker commented 3 weeks ago

Yes working now! Thank you very much @TriPSs , is this a known occurrence on v5.3.0?

TriPSs commented 2 weeks ago

Since v5 we include some presets in the action so users would not need to install it, little did I know that would case the preset to longer function if the users installs it him self.

To fix this I will just include all the presets.