Skip to content

Commit bd3cfb2

Browse files
committed
updated workflows
1 parent 92f6745 commit bd3cfb2

8 files changed

Lines changed: 35 additions & 19 deletions

File tree

.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
* text=auto eol=lf
22
*.bat text eol=crlf
3-
# Git LFS - track large binary files
4-
data/*.db filter=lfs diff=lfs merge=lfs -text

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727

2828
- name: Install dependencies
2929
run: npm ci
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3032

3133
- name: Run type checking
3234
run: npm run typecheck
@@ -62,6 +64,8 @@ jobs:
6264

6365
- name: Install dependencies
6466
run: npm ci
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6569

6670
- name: Build project
6771
run: npm run build

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ jobs:
3232
with:
3333
fetch-depth: 0
3434
ref: prod
35-
lfs: false # Disable LFS to save bandwidth (DB not needed for build/publish)
3635

3736
- name: Setup Node.js
3837
uses: actions/setup-node@v4
@@ -48,6 +47,8 @@ jobs:
4847
4948
- name: Install dependencies
5049
run: npm ci
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5152

5253
- name: Run validation
5354
run: npm run validate

.github/workflows/semantic-release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ jobs:
2121
with:
2222
fetch-depth: 0
2323
persist-credentials: false
24-
lfs: true
2524

2625
- name: Setup Node.js
2726
uses: actions/setup-node@v4
@@ -31,6 +30,13 @@ jobs:
3130

3231
- name: Install dependencies
3332
run: npm ci --ignore-scripts
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Download Database
37+
run: npm run postinstall
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3440

3541
- name: Build
3642
run: npm run build

.github/workflows/update-docs-weekly.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
with:
2323
ref: dev # Checkout dev branch to commit changes later
2424
fetch-depth: 0
25-
lfs: false # Disable LFS to save bandwidth (we rebuild the DB anyway)
2625

2726
- name: Setup Node.js
2827
uses: actions/setup-node@v4
@@ -37,6 +36,8 @@ jobs:
3736
3837
- name: Install dependencies
3938
run: npm ci
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4041

4142
- name: Get Latest Release Tag
4243
id: get_release

data/mcmodding-docs.db

Lines changed: 0 additions & 3 deletions
This file was deleted.

data/mod-examples.db

Lines changed: 0 additions & 3 deletions
This file was deleted.

scripts/postinstall.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -532,14 +532,20 @@ function printWelcomeScreen() {
532532

533533
function httpsGet(url, options = {}) {
534534
return new Promise((resolve, reject) => {
535+
const headers = {
536+
'User-Agent': CONFIG.userAgent,
537+
Accept: 'application/vnd.github.v3+json',
538+
...options.headers,
539+
};
540+
541+
if (process.env.GITHUB_TOKEN) {
542+
headers.Authorization = `Bearer ${process.env.GITHUB_TOKEN}`;
543+
}
544+
535545
const req = https.get(
536546
url,
537547
{
538-
headers: {
539-
'User-Agent': CONFIG.userAgent,
540-
Accept: 'application/vnd.github.v3+json',
541-
...options.headers,
542-
},
548+
headers,
543549
},
544550
(res) => {
545551
// Handle redirects
@@ -581,12 +587,18 @@ async function downloadWithProgress(url, destPath, onProgress) {
581587

582588
const makeRequest = (requestUrl) => {
583589
const urlObj = new URL(requestUrl);
590+
const headers = {
591+
'User-Agent': CONFIG.userAgent,
592+
};
593+
594+
if (process.env.GITHUB_TOKEN) {
595+
headers.Authorization = `Bearer ${process.env.GITHUB_TOKEN}`;
596+
}
597+
584598
const options = {
585599
hostname: urlObj.hostname,
586600
path: urlObj.pathname + urlObj.search,
587-
headers: {
588-
'User-Agent': CONFIG.userAgent,
589-
},
601+
headers,
590602
};
591603

592604
https

0 commit comments

Comments
 (0)