Skip to content

Commit 7e2c5e2

Browse files
committed
make username configurable
1 parent 27e28c8 commit 7e2c5e2

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

.github/workflows/build.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ jobs:
3737
- run: pnpm build
3838
env:
3939
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
40+
# Username that will be used to fetch the starred repos
41+
GITHUB_USERNAME: ${{ secrets.GH_USERNAME }}
4042

4143
- run: pnpm run deploy
4244
env:
4345
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
44-
46+
4547
- name: Commit & Push changes
4648
uses: actions-js/push@master
4749
with:

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4055,13 +4055,14 @@ This repo will automatically grab your stars and save them in chronological orde
40554055
2. Repository permissions
40564056
- Read access to metadata
40574057
- Read and Write access to code
4058-
3. Configure GitHub Actions keys `GH_TOKEN`
4058+
3. Configure GitHub Actions secrets `GH_TOKEN` and `GH_USERNAME`
40594059
4. Run Actions
40604060

4061-
If you have more than 5k stars, you might need to run this locally via `npm run build`
4061+
If you have more than 5k stars, you might need to run this locally via `npm run build`. Set the local env vars `GITHUB_TOKEN` and `GITHUB_USERNAME` and run the script.
40624062

40634063
```bash
4064-
export GH_TOKEN=your_token
4064+
export GITHUB_TOKEN=your_token
4065+
export GITHUB_USERNAME=davidwells
40654066
node index.js
40664067
```
40674068

src/_constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const __filename = fileURLToPath(import.meta.url)
66
const __dirname = path.dirname(__filename)
77

88
const { GITHUB_TOKEN } = process.env
9-
const GITHUB_USERNAME = 'davidwells'
9+
const GITHUB_USERNAME = process.env.GITHUB_USERNAME || 'davidwells'
1010
const SLASH_REPLACEMENT = '___|___'
1111

1212
const ROOT_DIRECTORY = path.join(__dirname, '..')

0 commit comments

Comments
 (0)