Skip to content

Commit

Permalink
allow specifying a custom commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
meorphis authored May 10, 2024
1 parent 4a114bf commit fcdfad7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ export async function main() {
const inputPath = getInput('input_path', { required: true });
const configPath = getInput('config_path', { required: false });
const projectName = getInput('project_name', { required: false });
const commitMessage = getInput('commit_message', { required: false });
const outputPath = getInput('output_path');

info(configPath ? 'Uploading spec and config files...' : 'Uploading spec file...');
const response = await uploadSpecAndConfig(inputPath, configPath, stainless_api_key, projectName);
const response = await uploadSpecAndConfig(
inputPath, configPath, stainless_api_key, projectName, commitMessage

Check failure on line 17 in index.ts

View workflow job for this annotation

GitHub Actions / eslint

Replace `·configPath,·stainless_api_key,·projectName,·commitMessage` with `⏎····configPath,⏎····stainless_api_key,⏎····projectName,⏎····commitMessage,`
);
if (!response.ok) {
const text = await response.text();
const errorMsg = `Failed to upload files: ${response.statusText} ${text}`;
Expand All @@ -33,10 +36,12 @@ async function uploadSpecAndConfig(
configPath: string,
token: string,
projectName: string,
commitMessage: string,
): Promise<Response> {
const formData = new FormData();

formData.set('projectName', projectName);
formData.set('commitMesssage', commitMessage);

// append a spec file
formData.set('oasSpec', await fileFrom(specPath, 'text/plain'));
Expand Down

0 comments on commit fcdfad7

Please sign in to comment.