Skip to content

Commit 32c7ada

Browse files
committed
Merge branch 'master' of github.com:expressjs/express into fix-redis-example
2 parents ff948b5 + 6b7ccfc commit 32c7ada

Some content is hidden

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

48 files changed

+595
-1306
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# http://editorconfig.org
1+
# https://editorconfig.org
22
root = true
33

44
[*]

.eslintrc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ rules:
88
indent: [error, 2, { MemberExpression: "off", SwitchCase: 1 }]
99
no-trailing-spaces: error
1010
no-unused-vars: [error, { vars: all, args: none, ignoreRestSiblings: true }]
11+
no-restricted-globals:
12+
- error
13+
- name: Buffer
14+
message: Use `import { Buffer } from "node:buffer"` instead of the global Buffer.

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: monthly
7+
8+
- package-ecosystem: npm
9+
directory: /
10+
schedule:
11+
interval: monthly
12+
time: "23:00"
13+
timezone: Europe/London
14+
open-pull-requests-limit: 10
15+
ignore:
16+
- dependency-name: "*"
17+
update-types: ["version-update:semver-major"]

.github/workflows/ci.yml

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ on:
1111
paths-ignore:
1212
- '*.md'
1313
pull_request:
14-
paths-ignore:
15-
- '*.md'
14+
workflow_dispatch:
15+
16+
permissions:
17+
contents: read
1618

1719
# Cancel in progress workflows
1820
# in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run
@@ -25,15 +27,16 @@ jobs:
2527
name: Lint
2628
runs-on: ubuntu-latest
2729
steps:
28-
- uses: actions/checkout@v4
29-
- name: Setup Node.js {{ matrix.node-version }}
30-
uses: actions/setup-node@v4
30+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3131
with:
32-
node-version: 'lts/*'
3332
persist-credentials: false
33+
- name: Setup Node.js
34+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
35+
with:
36+
node-version: 'lts/*'
3437

3538
- name: Install dependencies
36-
run: npm install --ignore-scripts --only=dev
39+
run: npm install --ignore-scripts --include=dev
3740

3841
- name: Run lint
3942
run: npm run lint
@@ -43,19 +46,19 @@ jobs:
4346
fail-fast: false
4447
matrix:
4548
os: [ubuntu-latest, windows-latest]
46-
node-version: [18, 19, 20, 21, 22, 23]
49+
node-version: [18, 19, 20, 21, 22, 23, 24, 25]
4750
# Node.js release schedule: https://nodejs.org/en/about/releases/
4851

4952
name: Node.js ${{ matrix.node-version }} - ${{matrix.os}}
5053

5154
runs-on: ${{ matrix.os }}
5255
steps:
53-
- uses: actions/checkout@v4
56+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
5457
with:
5558
persist-credentials: false
5659

5760
- name: Setup Node.js ${{ matrix.node-version }}
58-
uses: actions/setup-node@v4
61+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
5962
with:
6063
node-version: ${{ matrix.node-version }}
6164

@@ -74,44 +77,41 @@ jobs:
7477
7578
- name: Run tests
7679
shell: bash
77-
run: |
78-
npm run test-ci
79-
cp coverage/lcov.info "coverage/${{ matrix.node-version }}.lcov"
80-
81-
- name: Collect code coverage
82-
run: |
83-
mv ./coverage "./${{ matrix.node-version }}"
84-
mkdir ./coverage
85-
mv "./${{ matrix.node-version }}" "./coverage/${{ matrix.node-version }}"
80+
run: npm run test-ci
8681

8782
- name: Upload code coverage
88-
uses: actions/upload-artifact@v3
83+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
8984
with:
90-
name: coverage
91-
path: ./coverage
85+
name: coverage-node-${{ matrix.node-version }}-${{ matrix.os }}
86+
path: ./coverage/lcov.info
9287
retention-days: 1
9388

9489
coverage:
9590
needs: test
9691
runs-on: ubuntu-latest
92+
permissions:
93+
contents: read
94+
checks: write
9795
steps:
98-
- uses: actions/checkout@v4
99-
100-
- name: Install lcov
101-
shell: bash
102-
run: sudo apt-get -y install lcov
103-
104-
- name: Collect coverage reports
105-
uses: actions/download-artifact@v3
106-
with:
107-
name: coverage
108-
path: ./coverage
109-
110-
- name: Merge coverage reports
111-
shell: bash
112-
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info
113-
114-
- name: Upload coverage report
115-
uses: coverallsapp/github-action@master
116-
with:
117-
github-token: ${{ secrets.GITHUB_TOKEN }}
96+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
97+
with:
98+
persist-credentials: false
99+
100+
- name: Install lcov
101+
shell: bash
102+
run: sudo apt-get -y install lcov
103+
104+
- name: Collect coverage reports
105+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
106+
with:
107+
path: ./coverage
108+
pattern: coverage-node-*
109+
110+
- name: Merge coverage reports
111+
shell: bash
112+
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info
113+
114+
- name: Upload coverage report
115+
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
116+
with:
117+
file: ./lcov.info

.github/workflows/codeql.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
branches: ["master"]
2020
schedule:
2121
- cron: "0 0 * * 1"
22+
workflow_dispatch:
2223

2324
permissions:
2425
contents: read
@@ -31,16 +32,25 @@ jobs:
3132
actions: read
3233
contents: read
3334
security-events: write
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
language: [javascript, actions]
3439

3540
steps:
3641
- name: Checkout repository
37-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
42+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
43+
with:
44+
persist-credentials: false
3845

3946
# Initializes the CodeQL tools for scanning.
4047
- name: Initialize CodeQL
41-
uses: github/codeql-action/init@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7
48+
uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5
4249
with:
43-
languages: javascript
50+
languages: ${{ matrix.language }}
51+
config: |
52+
paths-ignore:
53+
- test
4454
# If you wish to specify custom queries, you can do so here or in a config file.
4555
# By default, queries listed here will override any specified in a config file.
4656
# Prefix the list here with "+" to use these queries and those in the config file.
@@ -61,6 +71,4 @@ jobs:
6171
# ./location_of_script_within_repo/buildscript.sh
6272

6373
- name: Perform CodeQL Analysis
64-
uses: github/codeql-action/analyze@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7
65-
with:
66-
category: "/language:javascript"
74+
uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5

.github/workflows/legacy.yml

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ on:
1313
pull_request:
1414
paths-ignore:
1515
- '*.md'
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: read
1620

1721
# Cancel in progress workflows
1822
# in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run
@@ -33,12 +37,12 @@ jobs:
3337

3438
runs-on: ${{ matrix.os }}
3539
steps:
36-
- uses: actions/checkout@v4
40+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3741
with:
3842
persist-credentials: false
3943

4044
- name: Setup Node.js ${{ matrix.node-version }}
41-
uses: actions/setup-node@v4
45+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
4246
with:
4347
node-version: ${{ matrix.node-version }}
4448

@@ -57,44 +61,41 @@ jobs:
5761
5862
- name: Run tests
5963
shell: bash
60-
run: |
61-
npm run test-ci
62-
cp coverage/lcov.info "coverage/${{ matrix.node-version }}.lcov"
63-
64-
- name: Collect code coverage
65-
run: |
66-
mv ./coverage "./${{ matrix.node-version }}"
67-
mkdir ./coverage
68-
mv "./${{ matrix.node-version }}" "./coverage/${{ matrix.node-version }}"
64+
run: npm run test-ci
6965

7066
- name: Upload code coverage
71-
uses: actions/upload-artifact@v3
67+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
7268
with:
73-
name: coverage
74-
path: ./coverage
69+
name: coverage-node-${{ matrix.node-version }}-${{ matrix.os }}
70+
path: ./coverage/lcov.info
7571
retention-days: 1
7672

7773
coverage:
7874
needs: test
7975
runs-on: ubuntu-latest
76+
permissions:
77+
contents: read
78+
checks: write
8079
steps:
81-
- uses: actions/checkout@v4
82-
83-
- name: Install lcov
84-
shell: bash
85-
run: sudo apt-get -y install lcov
86-
87-
- name: Collect coverage reports
88-
uses: actions/download-artifact@v3
89-
with:
90-
name: coverage
91-
path: ./coverage
92-
93-
- name: Merge coverage reports
94-
shell: bash
95-
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info
96-
97-
- name: Upload coverage report
98-
uses: coverallsapp/github-action@master
99-
with:
100-
github-token: ${{ secrets.GITHUB_TOKEN }}
80+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
81+
with:
82+
persist-credentials: false
83+
84+
- name: Install lcov
85+
shell: bash
86+
run: sudo apt-get -y install lcov
87+
88+
- name: Collect coverage reports
89+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
90+
with:
91+
path: ./coverage
92+
pattern: coverage-node-*
93+
94+
- name: Merge coverage reports
95+
shell: bash
96+
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info
97+
98+
- name: Upload coverage report
99+
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
100+
with:
101+
file: ./lcov.info

.github/workflows/scorecard.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# This workflow uses actions that are not certified by GitHub. They are provided
2+
# by a third-party and are governed by separate terms of service, privacy
3+
# policy, and support documentation.
4+
5+
name: Scorecard supply-chain security
6+
on:
7+
# For Branch-Protection check. Only the default branch is supported. See
8+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
9+
branch_protection_rule:
10+
# To guarantee Maintained check is occasionally updated. See
11+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
12+
schedule:
13+
- cron: '16 21 * * 1'
14+
push:
15+
branches: [ "master" ]
16+
17+
# Declare default permissions as read only.
18+
permissions: read-all
19+
20+
jobs:
21+
analysis:
22+
name: Scorecard analysis
23+
runs-on: ubuntu-latest
24+
permissions:
25+
# Needed to upload the results to code-scanning dashboard.
26+
security-events: write
27+
# Needed to publish results and get a badge (see publish_results below).
28+
id-token: write
29+
# Uncomment the permissions below if installing in a private repository.
30+
# contents: read
31+
# actions: read
32+
33+
steps:
34+
- name: "Checkout code"
35+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
36+
with:
37+
persist-credentials: false
38+
39+
- name: "Run analysis"
40+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
41+
with:
42+
results_file: results.sarif
43+
results_format: sarif
44+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
45+
# - you want to enable the Branch-Protection check on a *public* repository, or
46+
# - you are installing Scorecard on a *private* repository
47+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
48+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
49+
50+
# Public repositories:
51+
# - Publish results to OpenSSF REST API for easy access by consumers
52+
# - Allows the repository to include the Scorecard badge.
53+
# - See https://github.com/ossf/scorecard-action#publishing-results.
54+
# For private repositories:
55+
# - `publish_results` will always be set to `false`, regardless
56+
# of the value entered here.
57+
publish_results: true
58+
59+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
60+
# format to the repository Actions tab.
61+
- name: "Upload artifact"
62+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
63+
with:
64+
name: SARIF file
65+
path: results.sarif
66+
retention-days: 5
67+
68+
# Upload the results to GitHub's code scanning dashboard.
69+
- name: "Upload to code-scanning"
70+
uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5
71+
with:
72+
sarif_file: results.sarif

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ npm-shrinkwrap.json
55
*.log
66
*.gz
77

8+
# Yarn
9+
yarn-error.log
10+
yarn.lock
11+
812
# Coveralls
913
.nyc_output
1014
coverage

0 commit comments

Comments
 (0)