Skip to content

Commit 06ddf72

Browse files
committed
Merge branch 'main' into fix-allof-in-array-item
2 parents 58cfd94 + afa156a commit 06ddf72

56 files changed

Lines changed: 4125 additions & 4046 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-perf.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ on:
99

1010
jobs:
1111
build-size:
12+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
1213
name: Build Size Report
1314
timeout-minutes: 30
1415
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
pull-requests: write
1519
steps:
1620
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1721
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
1822
with:
19-
node-version: "18"
23+
node-version: "20"
2024
cache: yarn
2125
- uses: preactjs/compressed-size-action@946a292cd35bd1088e0d7eb92b69d1a8d5b5d76a # v2
2226
with:
@@ -29,9 +33,12 @@ jobs:
2933
compression: none
3034

3135
build-time:
36+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
3237
name: Build Time Perf
3338
timeout-minutes: 30
3439
runs-on: ubuntu-latest
40+
permissions:
41+
contents: read
3542
steps:
3643
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
3744
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4

.github/workflows/canary-beta-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Set up Node
2424
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
2525
with:
26-
node-version: "18"
26+
node-version: "20"
2727
cache: yarn
2828
- name: Prepare git
2929
run: |

.github/workflows/canary-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Set up Node
2424
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
2525
with:
26-
node-version: "18"
26+
node-version: "20"
2727
cache: yarn
2828
- name: Prepare git
2929
run: |

.github/workflows/deploy-live.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
build:
9-
if: github.repository_owner == 'PaloAltoNetworks'
9+
if: github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs'
1010
name: Build
1111
runs-on: ubuntu-latest
1212

@@ -35,6 +35,7 @@ jobs:
3535
path: build.zip
3636

3737
deploy:
38+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
3839
name: Deploy
3940
needs: build
4041
runs-on: ubuntu-latest

.github/workflows/deploy-preview.yml

Lines changed: 85 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,29 @@ on:
66

77
jobs:
88
precheck:
9+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
910
name: Precheck
1011
runs-on: ubuntu-latest
1112
permissions:
1213
contents: read
13-
security-events: write
1414
outputs:
1515
is-org-member-result: ${{ steps.is-org-member.outputs.is-org-member-result }}
1616
steps:
1717
- name: Check if actor is org member
1818
id: is-org-member
19-
run: echo "is-org-member-result=$(gh api -X GET orgs/PaloAltoNetworks/memberships/${{ github.actor }} | jq -r .message)" >> "$GITHUB_OUTPUT"
20-
env:
21-
GH_TOKEN: ${{ secrets.PAT }}
19+
run: |
20+
status=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $GH_TOKEN" \
21+
https://api.github.com/orgs/PaloAltoNetworks/members/${{ github.actor }})
22+
if [ "$status" = "204" ]; then
23+
echo "is-org-member-result=true" >> "$GITHUB_OUTPUT"
24+
else
25+
echo "is-org-member-result=false" >> "$GITHUB_OUTPUT"
26+
fi
27+
env:
28+
GH_TOKEN: ${{ secrets.PAT }}
2229

2330
analyze:
24-
if: github.repository_owner == 'PaloAltoNetworks' && needs.precheck.outputs.is-org-member-result == 'null'
31+
if: github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' && needs.precheck.outputs.is-org-member-result == 'true'
2532
name: Analyze
2633
needs: precheck
2734
runs-on: ubuntu-latest
@@ -49,7 +56,7 @@ jobs:
4956
uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3
5057

5158
analyze_unsafe:
52-
if: github.repository_owner == 'PaloAltoNetworks' && needs.precheck.outputs.is-org-member-result != 'null'
59+
if: github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' && needs.precheck.outputs.is-org-member-result == 'false'
5360
name: Analyze Unsafe
5461
needs: precheck
5562
runs-on: ubuntu-latest
@@ -81,7 +88,8 @@ jobs:
8188
name: Build
8289
needs: [analyze, analyze_unsafe]
8390
if: |
84-
!failure() && !cancelled() &&
91+
github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' &&
92+
!failure() && !cancelled() &&
8593
(success('analyze') || success('analyze_unsafe'))
8694
runs-on: ubuntu-latest
8795
permissions:
@@ -116,8 +124,14 @@ jobs:
116124
deploy:
117125
name: Deploy
118126
needs: build
119-
if: ${{ !failure() && !cancelled() }}
127+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' && !failure() && !cancelled() }}
120128
runs-on: ubuntu-latest
129+
permissions:
130+
contents: read
131+
pull-requests: write
132+
checks: write
133+
outputs:
134+
preview_url: ${{ steps.deploy_preview.outputs.details_url }}
121135

122136
steps:
123137
- name: Checkout repository
@@ -147,3 +161,66 @@ jobs:
147161
channelId: "pr${{ github.event.number }}"
148162
env:
149163
FIREBASE_CLI_PREVIEWS: hostingchannels
164+
165+
visual_diff:
166+
name: Visual Diff
167+
needs: deploy
168+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' && !failure() && !cancelled() }}
169+
runs-on: ubuntu-latest
170+
permissions:
171+
contents: read
172+
173+
steps:
174+
- name: Checkout repository
175+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
176+
with:
177+
ref: ${{ github.event.pull_request.head.sha }}
178+
179+
- name: Setup node
180+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
181+
with:
182+
node-version: "20"
183+
cache: "yarn"
184+
185+
- name: Install dependencies
186+
run: yarn --prefer-offline
187+
188+
- name: Install Playwright
189+
run: npx playwright install --with-deps chromium
190+
191+
- name: Run visual diff
192+
run: yarn ts-node scripts/sitemap-visual-diff.ts --preview-url ${{ needs.deploy.outputs.preview_url }} --summary-file visual_diffs/results.json --concurrency 4 --paths "/tests/"
193+
194+
- name: Generate report and summary
195+
run: yarn ts-node scripts/generate-visual-diff-report.ts visual_diffs/results.json visual_diffs/index.html
196+
197+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
198+
if: always()
199+
with:
200+
name: visual_diffs
201+
path: visual_diffs
202+
203+
# - name: Comment PR with results
204+
# if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
205+
# uses: actions/github-script@v7
206+
# with:
207+
# github-token: ${{ secrets.GITHUB_TOKEN }}
208+
# script: |
209+
# const fs = require('fs');
210+
# const results = JSON.parse(fs.readFileSync('visual_diffs/results.json', 'utf8'));
211+
# const runUrl = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`;
212+
# let body = `### Visual Diff Summary\n\n[View Logs](${runUrl})\n\n`;
213+
# body += `Total: ${results.summary.total}, Matches: ${results.summary.matches}, Diffs: ${results.summary.mismatches}, Skipped: ${results.summary.skipped}\n\n`;
214+
# if (results.pages.length) {
215+
# body += '| Page | Status |\n| --- | --- |\n';
216+
# for (const p of results.pages) {
217+
# if (p.status !== 'match') {
218+
# body += `| ${p.path} | ${p.status} |\n`;
219+
# }
220+
# }
221+
# }
222+
# await github.rest.issues.createComment({
223+
# ...context.repo,
224+
# issue_number: context.issue.number,
225+
# body
226+
# });

.github/workflows/pr-title-check.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414

1515
jobs:
1616
check:
17+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
1718
name: Check
1819
runs-on: ubuntu-latest
1920
steps:

.github/workflows/release-beta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
git config user.email "github-actions[bot]@users.noreply.github.com"
2323
- uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # v2
2424
with:
25-
node-version: "*"
25+
node-version: "20"
2626
registry-url: "https://registry.npmjs.org"
2727
- name: Release Beta
2828
run: npx ts-node --transpile-only scripts/publish-beta.ts

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
git config user.email "github-actions[bot]@users.noreply.github.com"
2424
- uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # v2
2525
with:
26-
node-version: "*"
26+
node-version: "20"
2727
registry-url: "https://registry.npmjs.org"
2828
- name: Release
2929
run: npx ts-node --transpile-only scripts/publish.ts

.github/workflows/validate.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@ env:
1111

1212
jobs:
1313
prepare-yarn-cache:
14+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
1415
name: Prepare Cache
1516
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
1619
steps:
1720
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1821
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
1922
with:
20-
node-version: "18"
23+
node-version: "20"
2124
- uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # v3
2225
with:
2326
path: |
@@ -29,14 +32,17 @@ jobs:
2932
run: yarn install --frozen-lockfile
3033

3134
lint:
35+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
3236
name: Lint
3337
needs: prepare-yarn-cache
3438
runs-on: ubuntu-latest
39+
permissions:
40+
contents: read
3541
steps:
3642
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
3743
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
3844
with:
39-
node-version: "18"
45+
node-version: "20"
4046
- uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # v3
4147
with:
4248
path: |
@@ -51,14 +57,17 @@ jobs:
5157
run: yarn lint --max-warnings 0
5258

5359
test:
60+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
5461
name: Test
5562
needs: prepare-yarn-cache
5663
runs-on: ubuntu-latest
64+
permissions:
65+
contents: read
5766
steps:
5867
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
5968
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
6069
with:
61-
node-version: "18"
70+
node-version: "20"
6271
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
6372
with:
6473
path: |
@@ -71,14 +80,17 @@ jobs:
7180
run: yarn test
7281

7382
cypress:
83+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
7484
name: Cypress
7585
needs: prepare-yarn-cache
7686
runs-on: ubuntu-latest
87+
permissions:
88+
contents: read
7789
steps:
7890
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
7991
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
8092
with:
81-
node-version: "18"
93+
node-version: "20"
8294
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
8395
with:
8496
path: |

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,6 @@ demo/**/versions.json
143143

144144
.idea
145145
.tool-versions
146+
147+
# Playwright
148+
visual_diffs/

0 commit comments

Comments
 (0)