diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6bd3941d..02131d800 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,3 +99,6 @@ jobs: - name: Build run: npm run build working-directory: ${{ matrix.node }}/${{ matrix.flavor }}/frontend + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/frontend/sync-assets.js b/frontend/sync-assets.js index 26d84e319..49618dea3 100644 --- a/frontend/sync-assets.js +++ b/frontend/sync-assets.js @@ -26,6 +26,8 @@ try { } } +const githubSecret = process.env.GITHUB_TOKEN; + function download(filename, url) { https.get(url, (response) => { if (response.statusCode < 200 || response.statusCode > 299) { @@ -55,6 +57,12 @@ function downloadMiningPoolLogos$() { headers: {'user-agent': 'node.js'} }; + if (githubSecret) { + console.log('Downloading the mining pool logos with authentication'); + options.headers['authorization'] = `Bearer ${githubSecret}`; + options.headers['X-GitHub-Api-Version'] = '2022-11-28'; + } + https.get(options, (response) => { const chunks_of_data = []; @@ -109,6 +117,13 @@ function downloadPromoVideoSubtiles$() { headers: {'user-agent': 'node.js'} }; + if (githubSecret) { + console.log('Downloading the promo video subtitles with authentication'); + options.headers['authorization'] = `Bearer ${githubSecret}`; + options.headers['X-GitHub-Api-Version'] = '2022-11-28'; + } + + https.get(options, (response) => { const chunks_of_data = []; @@ -163,6 +178,12 @@ function downloadPromoVideo$() { headers: {'user-agent': 'node.js'} }; + if (githubSecret) { + console.log('Downloading the promo videos with authentication'); + options.headers['authorization'] = `Bearer ${githubSecret}`; + options.headers['X-GitHub-Api-Version'] = '2022-11-28'; + } + https.get(options, (response) => { const chunks_of_data = [];