Skip to content

Commit e30a254

Browse files
committed
feat: add GitHub API headers for tag fetching
1 parent 6ce7ce9 commit e30a254

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

update.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
import fs from 'fs';
44
import { execSync } from 'child_process';
55

6+
const headers = {
7+
'User-Agent': 'shopware tag updater',
8+
}
9+
10+
if (process.env.GITHUB_TOKEN) {
11+
headers['Authorization'] = `Bearer ${process.env.GITHUB_TOKEN}`;
12+
}
13+
614
/**
715
* Update Shopware core to latest version
816
*
@@ -14,7 +22,9 @@ import { execSync } from 'child_process';
1422
async function update() {
1523
try {
1624
// Fetch tags from GitHub
17-
const response = await fetch('https://api.github.com/repos/shopware/core/tags?per_page=50');
25+
const response = await fetch('https://api.github.com/repos/shopware/core/tags?per_page=50', {
26+
headers
27+
});
1828
const tags = await response.json();
1929

2030
// Process each tag

0 commit comments

Comments
 (0)