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

fix: githubApiToken not equal lead to bad credentials #70 #74

Merged
merged 1 commit into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 23 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@

---

<p align="center" >
<strong>GitHub Statistics</strong>
<strong>GitHub Statistics</strong>
</p>

---

![trynow](https://img.shields.io/badge/TRY-NOW-green?url=https://vesoft-inc.github.io/github-statistics/)
Expand All @@ -23,7 +20,7 @@

![Image of Yaktocat](/src/image/WX20190912-173245.png)

# Features (WIP)
# Features

- [x] Repository overview
- [x] Star history
Expand All @@ -41,18 +38,32 @@ Feature requests are also warmly welcomed.

# Development

1. `git clone` and `npm -i` to set up the enviroment.
1. clone repo.

```shell
git clone https://github.com/vesoft-inc/github-statistics.git
```

2. install npm modules.

```shell
cd github-statistics
npm install
```

2. set `YOUR_GITHUB_API_TOKEN` in the [.env](./.env) file.
3. **MUST SET** `YOUR_GITHUB_API_TOKEN` in the [.env](./.env) file. Read [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) to create token if you don't have one.

3. `npm start`
4. runs the app in the development mode, open [http://localhost:3000](http://localhost:3000) to view it in the browser.

Runs the app in the development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
```shell
npm start
```

`npm run build`
Build the app for production to the `build` folder.<br>

Builds the app for production to the `build` folder.<br>
```shell
npm run build
```

---

Expand Down
2 changes: 1 addition & 1 deletion src/components/GithubStatistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class GithubStatistics extends React.Component {
/* eslint-disable-next-line */
var t = btoa(GITHUB_API_TOKEN)
/* eslint-disable-next-line */
this.fetcher = new GithubFetcher(btoa(t))
this.fetcher = new GithubFetcher(t)
this.props.updateState("githubApiToken", t)

this.search = _.debounce(
Expand Down
3 changes: 1 addition & 2 deletions src/reducers/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ const INITIAL_STATE = {
releaseData: [],
releaseStats: {},

githubApiToken: 'Z2hwX29XQWdNS3gxeXNHRXBlTzV6OEdpdWZvNjc0WkhWZTN0bVlJVQ==',

githubApiToken: btoa(process.env.REACT_APP_GITHUB_API_TOKEN),
}

const github = (state = INITIAL_STATE, action) => {
Expand Down