Skip to content

Commit 35bfd83

Browse files
Make GitHub organization configurable via environment variable
1 parent ac77b26 commit 35bfd83

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
# PR Viewer
22

3-
This React application allows you to view open pull requests from GitHub repositories in the OpenDevin organization.
3+
This React application allows you to view open pull requests from GitHub repositories in a GitHub organization. By default, it uses the All-Hands-AI organization.
44

55
## Setup
66

77
1. Clone the repository
88
2. Install dependencies: `npm install`
9-
3. Create a `.env` file in the root directory and add your GitHub token:
9+
3. Create a `.env` file in the root directory and add your configuration:
1010
```
11+
# Required: GitHub token for API access
1112
VITE_GITHUB_TOKEN=your_github_token_here
13+
14+
# Optional: GitHub organization to fetch repositories from (defaults to All-Hands-AI)
15+
VITE_GITHUB_ORG=your_github_org_here
1216
```
1317
4. Run the development server: `npm run dev`
1418
5. Open your browser and navigate to the URL provided by Vite (usually http://localhost:5173)
@@ -23,7 +27,7 @@ To build the app for production, use: `npm run build`
2327

2428
## Note
2529

26-
Make sure to replace `your_github_token_here` with an actual GitHub personal access token that has the necessary permissions to read repository and pull request information from the OpenDevin organization.
30+
Make sure to replace `your_github_token_here` with an actual GitHub personal access token that has the necessary permissions to read repository and pull request information from the target organization.
2731

2832
## License
2933

src/PullRequestViewer.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Octokit } from '@octokit/rest';
66
import Select from 'react-select';
77

88
const octokit = new Octokit({ auth: import.meta.env.VITE_GITHUB_TOKEN });
9+
const GITHUB_ORG = import.meta.env.VITE_GITHUB_ORG || 'All-Hands-AI';
910

1011
interface PullRequest {
1112
title: string;
@@ -29,7 +30,7 @@ const PullRequestViewer: React.FC = () => {
2930
const fetchRepos = async () => {
3031
try {
3132
const response = await octokit.repos.listForOrg({
32-
org: 'OpenDevin',
33+
org: GITHUB_ORG,
3334
type: 'all',
3435
});
3536
const repoOptions = response.data.map(repo => ({
@@ -54,7 +55,7 @@ const PullRequestViewer: React.FC = () => {
5455

5556
while (hasNextPage) {
5657
const response = await octokit.pulls.list({
57-
owner: 'OpenDevin',
58+
owner: GITHUB_ORG,
5859
repo: selectedRepo.value,
5960
state: 'open',
6061
per_page: 100,

0 commit comments

Comments
 (0)