Skip to content

Commit 0a29f1d

Browse files
ci: bump xiaotianxt/bypass-cloudflare-for-github-action from 1.1.1 to 2.0.1 (#799)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Matej Voboril <[email protected]>
1 parent 1fcf8fb commit 0a29f1d

File tree

6 files changed

+14732
-14816
lines changed

6 files changed

+14732
-14816
lines changed

.github/workflows/build.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
build:
1313
name: Build
1414
runs-on: ubuntu-latest
15-
1615
steps:
1716
- uses: actions/checkout@v5
1817
with:
@@ -24,11 +23,6 @@ jobs:
2423
- run: npm install
2524
- run: npm i -D warframe-patchlogs@^2
2625
- run: npm i --no-save warframe-worldstate-data@^3
27-
- name: Bypass Cloudflare for GitHub Action
28-
uses: xiaotianxt/[email protected]
29-
with:
30-
cf_zone_id: ${{ secrets.CF_ZONE_ID }}
31-
cf_api_token: ${{ secrets.CF_API_TOKEN }}
3226
- if: ${{ github.event_name == 'schedule' }}
3327
run: npm run build
3428
env:

.github/workflows/static.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,8 @@ jobs:
3636
name: Build
3737
runs-on: ubuntu-latest
3838
needs: [lint]
39-
env:
40-
cf_zone_id: ${{ secrets.CF_ZONE_ID }}
41-
cf_api_token: ${{ secrets.CF_API_TOKEN }}
4239
steps:
4340
- uses: actions/checkout@v5
44-
- name: Bypass Cloudflare for GitHub Action
45-
if: ${{ env.cf_api_token != ''&& env.cf_zone_id != '' }}
46-
uses: xiaotianxt/[email protected]
47-
with:
48-
cf_zone_id: ${{ env.cf_zone_id }}
49-
cf_api_token: ${{ env.cf_api_token }}
5041
- uses: leafo/[email protected]
5142
- uses: actions/cache@v4
5243
with:

build/.eslintrc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
extends: '@wfcd/eslint-config/esm'
22
rules:
33
no-console: off
4+
import/no-extraneous-dependencies: off

build/network.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,20 @@ const sanitize = (str) => str.replace(/\\r|\r?\n|\x09/g, '').replace(/\\\\"/g, "
1212
export const get = async (url, disableProxy = !prod, compress = false) => {
1313
const res = await fetch(url, {
1414
agent: disableProxy ? undefined : agent,
15+
headers: {
16+
'user-agent': 'node-fetch (warframe-items)',
17+
},
1518
});
1619
return compress === false ? Uint8Array.from(await res.buffer()) : res.text();
1720
};
1821

1922
export const getJSON = async (url, disableProxy) => {
20-
return JSON.parse(sanitize(await get(url, disableProxy, true)));
23+
try {
24+
return JSON.parse(sanitize(await get(url, disableProxy, true)));
25+
} catch (err) {
26+
console.error(`failed to get json from ${url}: ${err.message}`);
27+
process.exit(1);
28+
}
2129
};
2230

2331
export const retryAttempts = async (numAttempts, workerFn) => {

build/scraper.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class Scraper {
3232
// If this call is successful, it means that the origin server is available.
3333
await this.fetchEndpoints(true, 'en');
3434
} catch (err) {
35-
console.error(err);
3635
// Origin server not available, fall back to content server
3736
this.originServerAvailable = false;
3837
console.warn(

0 commit comments

Comments
 (0)