Skip to content

Commit

Permalink
fix: githubApiToken not equal lead to bad credentials vesoft-inc#70
Browse files Browse the repository at this point in the history
  • Loading branch information
alwqx committed Apr 29, 2024
1 parent 2a29cb8 commit 715aaf0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
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

0 comments on commit 715aaf0

Please sign in to comment.