Skip to content

Commit 47e7b64

Browse files
committed
Allow heuristics only runs with --limit=0 and relax token checks
1 parent 6958572 commit 47e7b64

File tree

1 file changed

+7
-7
lines changed
  • docusaurus/scripts/strapi-release-analyzer

1 file changed

+7
-7
lines changed

docusaurus/scripts/strapi-release-analyzer/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -799,19 +799,19 @@ async function main() {
799799
if (!releaseUrl) {
800800
console.error('❌ Usage: node index.js <github-release-url> [--no-cache] [--refresh] [--cache-dir=PATH] [--limit=N-for-LLM] [--strict=aggressive|balanced|conservative] [--model=NAME]');
801801
console.error('Example: node index.js https://github.com/strapi/strapi/releases/tag/v5.29.0 --strict=aggressive');
802-
console.error('Note: All PRs are screened heuristically; --limit caps only LLM calls if provided.');
802+
console.error('Note: All PRs are screened heuristically; --limit caps only LLM calls if provided. Use --limit=0 for heuristics only.');
803803
process.exit(1);
804804
}
805805

806806
if (!GITHUB_TOKEN) {
807-
console.error('❌ GITHUB_TOKEN environment variable is not set');
808-
console.error('Please create a .env file with: GITHUB_TOKEN=your_token_here');
809-
process.exit(1);
807+
console.warn('⚠️ GITHUB_TOKEN not set — proceeding unauthenticated (lower rate limits)');
810808
}
811809

812-
if (!ANTHROPIC_API_KEY) {
813-
console.error('❌ ANTHROPIC_API_KEY environment variable is not set');
814-
console.error('Please create a .env file with: ANTHROPIC_API_KEY=your_api_key_here');
810+
const llmCapProvided = OPTIONS.limit !== undefined && OPTIONS.limit !== null;
811+
const willUseLLM = !(llmCapProvided && Number(OPTIONS.limit) === 0);
812+
if (willUseLLM && !ANTHROPIC_API_KEY) {
813+
console.error('❌ ANTHROPIC_API_KEY is required when LLM calls are enabled');
814+
console.error('Set --limit=0 to run heuristics only without an Anthropic key.');
815815
process.exit(1);
816816
}
817817

0 commit comments

Comments
 (0)