Skip to content

Commit 7812d77

Browse files
committed
chore: use github token from environment when fetching templates
1 parent fae1e55 commit 7812d77

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

.github/workflows/autofix.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121

2222
- name: 📦 Install dependencies
2323
run: pnpm install
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2426

2527
- name: 🔠 Lint project (+ fix)
2628
run: pnpm run lint:fix

.github/workflows/bench.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626

2727
- name: 📦 Install dependencies
2828
run: pnpm install
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2931

3032
- name: 🛠 Build project
3133
run: pnpm build

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ jobs:
9393

9494
- name: 📦 Install dependencies
9595
run: pnpm install
96+
env:
97+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9698

9799
- name: 🛠 Build project
98100
run: pnpm build

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929

3030
- name: 📦 Install dependencies
3131
run: pnpm install
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3234

3335
- name: 🛠 Build project
3436
run: pnpm build

packages/nuxi/src/utils/starter-templates.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import process from 'node:process'
12
import { $fetch } from 'ofetch'
23

34
export const hiddenTemplates = [
@@ -25,6 +26,7 @@ const fetchOptions = {
2526
responseType: 'json',
2627
headers: {
2728
'user-agent': '@nuxt/cli',
29+
...process.env.GITHUB_TOKEN ? { authorization: `token ${process.env.GITHUB_TOKEN}` } : {},
2830
},
2931
} as const
3032

0 commit comments

Comments
 (0)