{"id":19710631,"url":"https://github.com/rootstrap/rs-gpt-review","last_synced_at":"2025-05-07T18:09:24.753Z","repository":{"id":212548032,"uuid":"731717875","full_name":"rootstrap/rs-gpt-review","owner":"rootstrap","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-12T19:28:35.000Z","size":1589,"stargazers_count":6,"open_issues_count":9,"forks_count":0,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-07T18:09:18.558Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rootstrap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-14T17:59:07.000Z","updated_at":"2024-12-19T19:38:27.000Z","dependencies_parsed_at":"2023-12-14T21:46:50.663Z","dependency_job_id":null,"html_url":"https://github.com/rootstrap/rs-gpt-review","commit_stats":null,"previous_names":["rootstrap/rs-gpt-review"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Frs-gpt-review","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Frs-gpt-review/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Frs-gpt-review/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Frs-gpt-review/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootstrap","download_url":"https://codeload.github.com/rootstrap/rs-gpt-review/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252931555,"owners_count":21827112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T22:07:59.682Z","updated_at":"2025-05-07T18:09:24.723Z","avatar_url":"https://github.com/rootstrap.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":":warning: Don't install this bot in **public** repositories because it allows anyone to make calls to OpenAI (via Issue/PR comments), which can potentially be abused by malicious users.\n\n# rs-gpt-review GitHub Action\n\nrs-gpt-review is an AI-powered GitHub Action that generates helpful responses to comments on issues and pull requests. It's like having a conversation with `GPT-4`, but without actually leaving GitHub.\n\n## Getting Started\n\nTo use rs-gpt-review, you'll need to create an OpenAI API key and add rs-gpt-review to your workflow. Here are the steps to get started:\n\n1. Create an [OpenAI API key](https://platform.openai.com/account/api-keys) if you don't already have one. Keep in mind that you'll occur charges for using the API.\n2. Save your OpenAI API key as a [Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) in your repository.\n3. Create a new workflow in folder `.github/workflows` that will be triggered on [issues](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issues), [pull requests](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request) and [comments](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issue_comment).\n\n### Workflow\n\n```yaml\n# File: .github/workflows/rs-gpt-review.yml\nname: 'rs-gpt-review'\n\n# Run the workflow on new issues, pull requests and comments\non:\n  issues:\n    types: [opened]\n  pull_request:\n    types: [opened]\n  issue_comment:\n    types: [created]\n  pull_request_review_comment:\n    types: [created]\n\n# Allows the workflow to create comments on issues and pull requests\npermissions:\n  issues: write\n  pull-requests: write\n  contents: write\n\njobs:\n  # Runs for issues, pull requests and comments\n  rs-gpt-review:\n    name: rs-gpt-review comment\n    # Only run the job if the comment contains @rs-gpt-review\n    if: ${{ github.event_name == 'issues' \u0026\u0026 contains(github.event.issue.body, '@rs-gpt-review') || github.event_name == 'pull_request' \u0026\u0026 contains(github.event.pull_request.body, '@rs-gpt-review') || github.event_name == 'issue_comment' \u0026\u0026 contains(github.event.comment.body, '@rs-gpt-review') || github.event_name == 'pull_request_review_comment' \u0026\u0026 contains(github.event.comment.body, '@rs-gpt-review') }}\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      # The action will only run if the description or comments mentions @rs-gpt-review\n      - uses: rootstrap/rs-gpt-review@v2\n        name: rs-gpt-review\n        with:\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n          openai_key: ${{ secrets.OPENAI_KEY }}\n```\n\nThe action will only run if the issue, pull requests or comments mentions `@rs-gpt-review`. Otherwise, the action will return immediately without doing anything. If you want to skip the whole workflow run, you can use the [`if` conditional](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idif) to check if the issue, pull request or comment mentions `@rs-gpt-review`.\n\n```yml\njobs:\n  # Runs only for issues\n  issue:\n    name: Issue opened\n    # Check if the issue contains @rs-gpt-review, otherwise skip the workflow run\n    if: ${{ github.event_name == 'issues' \u0026\u0026 contains(github.event.issue.body, '@rs-gpt-review') }}\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: rootstrap/rs-gpt-review@v2\n        name: rs-gpt-review\n        with:\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n          openai_key: ${{ secrets.OPENAI_KEY }}\n```\n\nCheck out [`main.yml`](./.github/workflows/main.yml) for more examples.\n\n### Permissions\n\nThe `GITHUB_TOKEN` requires the following permissions to create comments on issues and pull requests:\n\n- `issues: write`\n- `pull-requests: write`\n- `contents: write`\n\nAdd these permissions to your workflow or individual jobs using the [`permissions`](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow) keyword.\n\n### Secrets\n\nSensitive information, such as the OpenAI API key, should be stored as [encrypted secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) in the repository.\n\nAdd your OpenAI API key as a secret to your repository and reference it using the `${{ secrets.OPENAI_KEY }}` syntax.\n\n## Action Inputs\n\n| Name                 | Required | Default | Description                                                                                                                                                                                                                                                                                                               |\n| -------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `github_token`       | Yes      |         | The access token used to retrieve and create comments on the issues and pull requests. This will typically be your GitHub token. If so, use `${{ secrets.GITHUB_TOKEN }}`                                                                                                                                                 |\n| `openai_key`         | Yes      |         | The API key used for OpenAI chat completion request. Go to [OpenAI](https://platform.openai.com/account/api-keys) to create a new API key                                                                                                                                                                                 |\n| `openai_temperature` | No       | 0.8     | What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. See [API reference](https://platform.openai.com/docs/api-reference/chat/create#completions/create-temperature) for more information. |     |     |     |     |     |     \n| `model` | No       | gpt-4     | Default model to use. See [available models](https://platform.openai.com/docs/models) for more information. |     |     |     |     |     |     \n| `files_excluded` | No       | empty     | Comma-separated file names to be excluded from diff, (e.g. file1,file2,file3). |     |     |     |     |     |     \n| `openai_top_p`       | No       | 0       | An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. See [API reference](https://platform.openai.com/docs/api-reference/chat/create#completions/create-top_p) for more information.                                     |\n| `openai_max_tokens`  | No       | 4096    | The maximum number of tokens to generate in the completion. See [API reference](https://platform.openai.com/docs/api-reference/chat/create#completions/create-max_tokens) for more information.                                                                                                                           |\n\n# Examples\n\n### [Explain Pull Requests](https://github.com/rootstrap/lambda-monitor/pull/7)\n![example](example.png)\n\n# Contributing\n\nWe welcome bug reports, feature requests, and contributions to rs-gpt-review! If you'd like to contribute, please open an issue or pull request on this repository.\n\n\n# Action development and maintenance\n\nTo test the action locally we can use `act`. This tool depends on `docker` to run workflows. For details you can check [this](https://github.com/nektos/act#installation) page.\n\nYou'll also need to create a [github personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) and openAI key.\n\n1. Install act\n\n```\nbrew install act\n```\n\n2. Create the secrets\ncreate a secret file to store the github action and\n\n```\necho \"GITHUB_TOKEN=\u003cMY_GITHUB_TOKEN\u003e\nOPENAI_KEY=\u003cMY_OPENAI_KEY\u003e\" \u003e .secrets\n```\n\n\n3. Run action workflow\n\n```\nnpm run pull_request\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootstrap%2Frs-gpt-review","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootstrap%2Frs-gpt-review","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootstrap%2Frs-gpt-review/lists"}