Skip to content

Commit 8978095

Browse files
committed
Merge branch 'master' of github.com:jsonwebtoken/jsonwebtoken.github.io
2 parents 1316a92 + 9d7e59e commit 8978095

File tree

669 files changed

+50439
-50645
lines changed

Some content is hidden

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

669 files changed

+50439
-50645
lines changed

.deployment-trigger

Lines changed: 0 additions & 1 deletion
This file was deleted.

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
GITHUB_APP_ID=
2+
GITHUB_APP_PRIVATE_KEY=
3+
GITHUB_INSTALLATION_ID=

.env.sample

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

.github/stale.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Vercel Preview Community Deployment
2+
env:
3+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
4+
VERCEL_PROJECT_ID: ${{ secrets.PREVIEW_VERCEL_PROJECT_ID }}
5+
on:
6+
push:
7+
branches:
8+
- production
9+
jobs:
10+
Deploy-Production:
11+
runs-on:
12+
labels: ubuntu-latest
13+
steps:
14+
- name: Checkout the Codebase
15+
uses: actions/checkout@v4
16+
- name: Install Vercel CLI
17+
run: npm install --global vercel@latest
18+
- name: Deploy on Vercel
19+
id: deploy
20+
run: |
21+
vercel deploy --prod --token=${{ secrets.VERCEL_ACCESS_TOKEN }}

.github/workflows/preview.yaml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Vercel Preview Deployment
2+
env:
3+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
4+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
5+
on:
6+
push:
7+
branches-ignore:
8+
- master
9+
- production
10+
jobs:
11+
Deploy-Preview:
12+
runs-on:
13+
labels: ubuntu-latest
14+
environment: preview
15+
outputs:
16+
deploymentUrl: ${{ steps.deploy.outputs.deploymentUrl }}
17+
steps:
18+
- name: Checkout the Codebase
19+
uses: actions/checkout@v4
20+
- name: Install Vercel CLI
21+
run: npm install --global vercel@latest
22+
- name: Deploy on Vercel
23+
id: deploy
24+
run: |
25+
vercel deploy --token=${{ secrets.VERCEL_ACCESS_TOKEN }} > deploy.log
26+
URL=$(cat deploy.log | grep -o 'https://[^ ]*.vercel.app' | head -n1)
27+
echo "deploymentUrl=$URL" >> $GITHUB_OUTPUT
28+
- name: Extract branch name
29+
shell: bash
30+
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
31+
id: extract_branch
32+
- name: Assign Custom Domain
33+
if: ${{ steps.extract_branch.outputs.branch == 'remove-basepath-2' }}
34+
run: |
35+
vercel alias set --token=${{ secrets.VERCEL_ACCESS_TOKEN }} ${{ steps.deploy.outputs.deploymentUrl }} ab-test-next-jwt-io.vercel.app --scope=okta
36+
37+
Add-Comment:
38+
runs-on:
39+
labels: ubuntu-latest
40+
needs: Deploy-Preview
41+
permissions:
42+
issues: write
43+
pull-requests: write
44+
steps:
45+
- name: Comment URL to PR
46+
uses: actions/github-script@v6
47+
id: comment-deployment-url-script
48+
env:
49+
DEPLOYMENT_URL: ${{ needs.Deploy-Preview.outputs.deploymentUrl }}
50+
with:
51+
script: |
52+
// Get pull requests that are open for current ref.
53+
const pullRequests = await github.rest.pulls.list({
54+
owner: context.repo.owner,
55+
repo: context.repo.repo,
56+
state: 'open',
57+
head: `${context.repo.owner}:${context.ref.replace('refs/heads/', '')}`
58+
})
59+
60+
// Set issue number for following calls from context (if on pull request event) or from above variable.
61+
const issueNumber = context.issue.number || pullRequests.data[0].number
62+
63+
// Retrieve existing bot comments for the PR
64+
const {data: comments} = await github.rest.issues.listComments({
65+
owner: context.repo.owner,
66+
repo: context.repo.repo,
67+
issue_number: issueNumber,
68+
})
69+
const botComment = comments.find(comment => {
70+
return comment.user.type === 'Bot' && comment.body.includes('Preview URL at')
71+
})
72+
73+
const output = "Preview URL " + process.env.DEPLOYMENT_URL
74+
75+
// If we have a comment, update it, otherwise create a new one
76+
if (botComment) {
77+
github.rest.issues.updateComment({
78+
owner: context.repo.owner,
79+
repo: context.repo.repo,
80+
comment_id: botComment.id,
81+
body: output
82+
})
83+
} else {
84+
github.rest.issues.createComment({
85+
issue_number: issueNumber,
86+
owner: context.repo.owner,
87+
repo: context.repo.repo,
88+
body: output
89+
})
90+
}

.github/workflows/production.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Vercel Production Deployment
2+
env:
3+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
4+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
5+
on:
6+
push:
7+
branches:
8+
- master
9+
- production
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '22'
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Run Vitest
25+
run: npx vitest run
26+
27+
- name: Install Playwright Browsers
28+
run: npx playwright install --with-deps
29+
30+
- name: Run Playwright Tests
31+
run: NODE_OPTIONS="--no-experimental-strip-types" npx playwright test
32+
33+
- name: Upload Playwright Traces
34+
if: failure()
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: playwright-traces
38+
path: playwright-report/**/trace.zip
39+
40+
Deploy-Production:
41+
needs: test
42+
runs-on:
43+
labels: ubuntu-latest
44+
steps:
45+
- name: Checkout the Codebase
46+
uses: actions/checkout@v4
47+
- name: Install Vercel CLI
48+
run: npm install --global vercel@latest
49+
- name: Deploy on Vercel
50+
id: deploy
51+
run: |
52+
vercel deploy --prod --token=${{ secrets.VERCEL_ACCESS_TOKEN }}

.github/workflows/test.yml

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

.github/workflows/tests.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Run Tests
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
push:
7+
branches: [master]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '22'
19+
20+
- name: Install dependencies
21+
run: npm ci
22+
23+
- name: Run Vitest
24+
run: npx vitest run
25+
26+
- name: Install Playwright Browsers
27+
run: npx playwright install --with-deps
28+
29+
- name: Run Playwright Tests
30+
run: NODE_OPTIONS="--no-experimental-strip-types" npx playwright test
31+
32+
- name: Upload Playwright Traces
33+
if: failure()
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: playwright-traces
37+
path: playwright-report/**/trace.zip
38+
39+

0 commit comments

Comments
 (0)