Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed
- Fixed OpenAI API error: only use response_format for models that support it (not gpt-4o-mini)
- Fixed commit message escaping to handle newlines and quotes in git commands
- Fixed error handling in ReleaseWorkflow to properly rethrow errors instead of returning default values
- Tool now properly reports failures instead of misleading success messages

## [1.0.3] - 2025-08-12

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion dist/ReleaseWorkflow.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/ai-analyzer.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/git-operations.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 7 additions & 14 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27659,7 +27659,8 @@ class GitOperations {
// There are staged changes, proceed with commit
}
// Commit changes
this.executeGitCommand(`commit -m "${message}"`);
const escapedMessage = message.replace(/"/g, '\\"').replace(/\n/g, '\\n');
this.executeGitCommand(`commit -m "${escapedMessage}"`);
const commitSha = this.executeGitCommand('rev-parse HEAD').trim();
core.info(`✅ Committed changes: ${commitSha.substring(0, 7)}`);
return commitSha;
Expand Down Expand Up @@ -36175,7 +36176,10 @@ Respond with valid JSON in this exact format:
],
temperature: this.config.temperature,
max_tokens: this.config.maxTokens,
response_format: { type: 'json_object' },
// Only use response_format for models that support it
...(this.config.model.includes('gpt-4') && !this.config.model.includes('mini')
? { response_format: { type: 'json_object' } }
: {}),
});
const choice = response.choices[0];
if (choice?.message?.content === undefined ||
Expand Down Expand Up @@ -36909,18 +36913,7 @@ class ReleaseWorkflow {
? error
: new WorkflowError(error instanceof Error ? error.message : 'Unknown workflow error', 'WORKFLOW_ERROR');
core.setFailed(workflowError.message);
return {
version: '0.0.0',
releaseBranch: '',
versionBump: 'patch',
changelogEntry: '',
analysisStrategy: this.config.versioningStrategy,
aiConfidence: undefined,
reasoning: [workflowError.message],
commitCount: 0,
breakingChanges: false,
changelogData: undefined,
};
throw workflowError;
}
}
/**
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

14 changes: 1 addition & 13 deletions src/ReleaseWorkflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,19 +211,7 @@ export class ReleaseWorkflow {
);

core.setFailed(workflowError.message);

return {
version: '0.0.0',
releaseBranch: '',
versionBump: 'patch',
changelogEntry: '',
analysisStrategy: this.config.versioningStrategy,
aiConfidence: undefined,
reasoning: [workflowError.message],
commitCount: 0,
breakingChanges: false,
changelogData: undefined,
};
throw workflowError;
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/ai-analyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ Respond with valid JSON in this exact format:
],
temperature: this.config.temperature,
max_tokens: this.config.maxTokens,
response_format: { type: 'json_object' },
// Only use response_format for models that support it
...(this.config.model.includes('gpt-4') && !this.config.model.includes('mini')
? { response_format: { type: 'json_object' } }
: {}),
});

const choice = response.choices[0];
Expand Down
7 changes: 4 additions & 3 deletions src/git-operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export class GitOperations {
// First, fetch all remote refs to ensure we have the latest information
this.executeGitCommand('fetch origin --prune');
core.debug(`Fetched latest remote references`);

// Try remote branch again after fetch
this.executeGitCommand(`rev-parse --verify origin/${branch}`);
core.debug(`Branch '${branch}' found as remote branch 'origin/${branch}' after fetch`);
Expand All @@ -218,7 +218,7 @@ export class GitOperations {
try {
this.executeGitCommand(`fetch origin ${branch}`);
core.debug(`Fetched specific branch '${branch}' from remote`);

// Verify it exists as a remote branch now
this.executeGitCommand(`rev-parse --verify origin/${branch}`);
core.debug(`Branch '${branch}' verified as remote branch after specific fetch`);
Expand Down Expand Up @@ -251,7 +251,8 @@ export class GitOperations {
}

// Commit changes
this.executeGitCommand(`commit -m "${message}"`);
const escapedMessage = message.replace(/"/g, '\\"').replace(/\n/g, '\\n');
this.executeGitCommand(`commit -m "${escapedMessage}"`);
const commitSha = this.executeGitCommand('rev-parse HEAD').trim();

core.info(`✅ Committed changes: ${commitSha.substring(0, 7)}`);
Expand Down