Skip to content

Commit

Permalink
test: teste novo assitente
Browse files Browse the repository at this point in the history
  • Loading branch information
leguass7 committed Nov 16, 2024
1 parent 068e1f5 commit a708013
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
15 changes: 6 additions & 9 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: 'AI Code Reviewer'
description: 'A GitHub Action to review your code.'
description: 'Action do GitHub para revisar seu código.'
author: 'Leandro Sbrissa'

# Add your action's branding here. This will appear on the GitHub Marketplace.
branding:
icon: 'heart'
color: 'red'

# Define your inputs here.
inputs:
GITHUB_TOKEN:
description: "GitHub token to interact with the repository."
description: "Token do GitHub para interagir com o repositório."
required: true
OPENAI_API_KEY:
description: "OpenAI API key for GPT."
Expand All @@ -20,22 +18,21 @@ inputs:
required: true
default: ""
exclude:
description: "Glob patterns to exclude files from the diff analysis"
description: "Glob patterns para excluir arquivos da análise de diff"
required: false
default: ""
language:
description: "Language of the code to be analyzed"
description: "Idioma dos comentários"
required: false
default: "pt-br"


# Define your outputs here.
outputs:
countFiles:
description: 'Quantidade de arquivos analisados'
countComments:
description: 'Quantidade de comentários feitos'

commentUrl:
description: 'URL do comentário feito'

runs:
using: 'node20'
Expand Down
8 changes: 8 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36570,6 +36570,14 @@ async function createReviewComment({ owner, repo, pullNumber }, comments) {
comments,
event: 'COMMENT'
});
if (!response) {
core.info('Failed to create review comment');
process.exit(0);
}
if (response?.data.html_url) {
core.setOutput('commentUrl', response?.data.html_url);
core.notice(`Review comment created: ${response?.data.html_url}`);
}
return response;
}

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions src/lib/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,15 @@ export async function createReviewComment({ owner, repo, pullNumber }: PRDetails
event: 'COMMENT'
});

if (!response) {
core.info('Failed to create review comment');
process.exit(0);
}

if (response?.data.html_url) {
core.setOutput('commentUrl', response?.data.html_url);
core.notice(`Review comment created: ${response?.data.html_url}`);
}

return response;
}

0 comments on commit a708013

Please sign in to comment.