Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github action #2

Merged
merged 4 commits into from
Apr 22, 2023
Merged

github action #2

merged 4 commits into from
Apr 22, 2023

Conversation

ravilushqa
Copy link
Owner

@ravilushqa ravilushqa commented Apr 22, 2023

Description

This pull request adds two new GitHub Actions to the repository: ChatGPT Code Review and GPT Pull Request Updater. The ChatGPT Code Review action is triggered on opened, reopened, and synchronization of pull requests events, and it requires permissions to read contents and write pull requests. The action runs on Ubuntu latest version platform and needs GITHUB_TOKEN and OPENAI_API_KEY secrets to be executed.

The GPT Pull Request Updater action includes a Go version 1.19 and is triggered to run on pull request creation and synchronization events. The workflow checks out the GPT-PullRequest-Updater repository, builds the description and review commands, and updates the pull request description and reviews using GitHub and OpenAI tokens, the repository owner, and the pull request number.

Changes

  • Added ChatGPT Code Review action to .github/workflows/cr.yml
  • Added GPT Pull Request Updater action to .github/workflows/gpt_pullrequest_updater.yml
  • Refactored code to add label condition for test job execution in .github/workflows/cr.yml
  • Added tool to update Pull Request description and review command in .github/workflows/gpt_pullrequest_updater.yml
  • Updated README.md with instructions for using the tool and GitHub Action setup.

@ravilushqa ravilushqa requested a review from vanilevsky April 22, 2023 07:43
@ravilushqa ravilushqa self-assigned this Apr 22, 2023
Repository owner deleted a comment from github-actions bot Apr 22, 2023
OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
PR_NUMBER: ${{ github.event.number }}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, the code patch looks good. Here are some suggestions:

  • In the "Set up Go" step, it might be helpful to specify a more specific Go version instead of using "1.19", which could become outdated.
  • Instead of hardcoding the repository owner and name in the "Checkout GPT-PullRequest-Updater" step, consider using the predefined "github" context variables. For example, you can use "github.repository_owner" and "github.event.repository.name" to get the owner and name of the repository where the pull request was opened/synchronized.
  • In the "Update Pull Request Description" and "Review Pull Request" steps, it might be a good idea to add some error handling and logging to make troubleshooting easier if something goes wrong.
  • Consider adding some comments to explain what each step does and why it's needed. This can be helpful for other contributors who might not be familiar with the codebase.


License
This project is licensed under the MIT License. No newline at end of file
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code patch adds a tool for updating and reviewing GitHub pull requests. The commands review and description are used to review pull requests and update the pull request description, respectively. The code also includes a GitHub action that can automatically run the review and description commands when a pull request is opened or synchronized.

The review and description commands require environment variables to be set, and the GitHub action uses secrets to access the necessary tokens. Test mode can be enabled by adding the --test flag.

Improvement suggestions:

  • Provide more detailed documentation on how to set the necessary environment variables and secrets.
  • Add error handling and logging to provide more informative error messages when there are issues.
  • Consider using a more descriptive name for the GitHub action workflow, to make it clear what it does.

@ravilushqa ravilushqa merged commit 2cd57d9 into main Apr 22, 2023
@ravilushqa ravilushqa deleted the github_action branch April 22, 2023 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant