Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot find module @gitbeaker/rest error occurs during Run code review script step in github workflow #323

Open
CirillaQL opened this issue Jan 29, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@CirillaQL
Copy link

Current Behavior:

error

Expected Behavior:

Run without error

Steps To Reproduce:

I try two kinds of workflow yml:
workflow_1
workflow_2
but both of them return same @gitbeaker/rest error

Environment:

github workflow

Anything else:

Hi, this CI yml from my own test project: https://github.com/CirillaQL/networkCheck . I set openai_key_value only in Settings->Actions->Repository secrets. Don't know how to fix it, may be @gitbeaker/rest new version problem?

Suggestions on the root cause

@CirillaQL CirillaQL added the bug Something isn't working label Jan 29, 2024
@mattzcarey
Copy link
Owner

Hi, thanks for your issue. There is an issue with eslint resolving exports in package.json. This causes an issue with the @gitbeaker/rest package. jdalrymple/gitbeaker#3230

I managed to replicate locally using pnpm to install but not with npm. And I am unable to replicate it in a github runner. Please can you try running the package locally with npm i code-review-gpt && npx code-review-gpt review

@CirillaQL
Copy link
Author

Hi, thanks for your issue. There is an issue with eslint resolving exports in package.json. This causes an issue with the @gitbeaker/rest package. jdalrymple/gitbeaker#3230

I managed to replicate locally using pnpm to install but not with npm. And I am unable to replicate it in a github runner. Please can you try running the package locally with npm i code-review-gpt && npx code-review-gpt review

Hi, sorry for this late response. I tried to run the package locally with npm i code-review-gpt && npx code-review-gpt review --ci=github --remote=CirillaQL/networkCheck#1 and it looks fine to me. I love this project and manage to introduce it to my CICD co-workers. Really hope can fix it in github runner. Should I keep this issue open?

@kakshaycs
Copy link

I am using something similar

name: Review GPT

on:
  pull_request:
    types: [opened, synchronize, reopened]

permissions:
  pull-requests: write
  contents: read
  issues: write

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      
      - uses: actions/setup-node@v3
        with:
          node-version: 18

      - name: Install Code Review GPT
        run: npm install code-review-gpt
      
      - name: Run Code Review GPT
        run: npx code-review-gpt review --ci=github --model=$MODEL
        
        env:
          GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
          MODEL: 'gpt-3.5-turbo'
          OPENAI_API_KEY: ${{ secrets.MY_SECRET_CODE }}
          BASE_SHA: ${{ github.event.pull_request.base.sha }}
          

The workflow ran successfully, but there was no output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants