Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Presubmit.ai workflow failing on PRs due to missing API key and invalid model #3372

Copy link
Copy link
@oldregime

Description

@oldregime
Issue body actions

Hey maintainers! 👋

I noticed that the Presubmit.ai workflow is failing on pull requests. I took a look at the workflow file and found a couple of issues that are causing the failures.

The Problem

The workflow in .github/workflows/presubmit.yml is failing with two errors:

  1. Missing API Key: The workflow checks for LLM_API_KEY but it's not configured in the repo secrets
  2. Invalid Model: The model gemini-1.5-flash isn't supported for the API version being used

This is blocking the AI reviewer from running on PRs, though it doesn't prevent merging since it's a separate check.

Current Workflow Code

- name: Check required secrets
  run: |
    if [ -z "${{ secrets.LLM_API_KEY }}" ]; then
      echo "Error: LLM_API_KEY secret is not configured"
      exit 1
    fi

- name: Run AI Reviewer
  uses: presubmit/ai-reviewer@latest
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
    LLM_MODEL: "gemini-1.5-flash"

Possible Solutions

Option 1: Fix the workflow (if you want to keep the AI reviewer)

  1. Add the LLM_API_KEY secret:

    • Go to Settings → Secrets and variables → Actions
    • Add a new secret named LLM_API_KEY with your Google AI API key
  2. Update the model to a supported version:

    LLM_MODEL: "gemini-1.5-flash-002"
    # or another model from the supported list

Option 2: Make it optional (recommended for now)

If you're not ready to configure the API key, you could make the workflow optional so it doesn't block contributors:

- name: Check required secrets
  id: check-secrets
  run: |
    if [ -z "${{ secrets.LLM_API_KEY }}" ]; then
      echo "LLM_API_KEY not configured, skipping AI review"
      echo "skip=true" >> $GITHUB_OUTPUT
    fi

- name: Run AI Reviewer
  if: steps.check-secrets.outputs.skip != 'true'
  uses: presubmit/ai-reviewer@latest
  # ... rest of the config

Option 3: Disable the workflow temporarily

If the AI reviewer isn't critical right now, you could disable it:

  • Go to Actions tab
  • Select "Presubmit.ai" workflow
  • Click the "..." menu
  • Select "Disable workflow"

Impact

Right now this doesn't block PRs from being merged, but contributors might see a red X on their PRs which can be confusing. Making it optional or fixing it would improve the contributor experience.

Let me know if you'd like me to submit a PR for any of these solutions!

Thanks for maintaining this awesome repo! ��

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.