Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bazhuang/express
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: expressjs/express
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing with 15,736 additions and 5,141 deletions.
  1. +11 −0 .editorconfig
  2. +2 −0 .eslintignore
  3. +10 −0 .eslintrc.yml
  4. +17 −0 .github/dependabot.yml
  5. +114 −0 .github/workflows/ci.yml
  6. +66 −0 .github/workflows/codeql.yml
  7. +98 −0 .github/workflows/legacy.yml
  8. +72 −0 .github/workflows/scorecard.yml
  9. +14 −14 .gitignore
  10. +0 −11 .npmignore
  11. +1 −0 .npmrc
  12. +0 −10 .travis.yml
  13. +92 −0 Charter.md
  14. +139 −0 Code-Of-Conduct.md
  15. +51 −0 Collaborator-Guide.md
  16. +234 −14 Contributing.md
  17. +2,074 −18 History.md
  18. +2 −0 LICENSE
  19. +125 −0 Readme-Guide.md
  20. +193 −54 Readme.md
  21. +202 −0 Release-Process.md
  22. +56 −0 Security.md
  23. +72 −0 Triager-Guide.md
  24. +12 −8 benchmarks/Makefile
  25. +34 −0 benchmarks/README.md
  26. +2 −5 benchmarks/middleware.js
  27. +5 −3 benchmarks/run
  28. +29 −0 examples/README.md
  29. +15 −11 examples/auth/{app.js → index.js}
  30. +0 −48 examples/auth/pass.js
  31. +3 −1 examples/auth/views/head.ejs
  32. +6 −7 examples/auth/views/login.ejs
  33. +0 −31 examples/big-view/index.js
  34. +0 −12 examples/big-view/pets.jade
  35. +3 −1 examples/content-negotiation/db.js
  36. +2 −0 examples/content-negotiation/index.js
  37. +1 −0 examples/content-negotiation/users.js
  38. +7 −8 examples/cookie-sessions/index.js
  39. +11 −6 examples/cookies/{app.js → index.js}
  40. +0 −48 examples/cors/index.js
  41. +0 −12 examples/cors/public/index.html
  42. +0 −36 examples/downloads/app.js
  43. +3 −0 examples/downloads/files/notes/groceries.txt
  44. +0 −1 examples/downloads/files/utf-8 한中日.txt
  45. +40 −0 examples/downloads/index.js
  46. +8 −1 examples/ejs/index.js
  47. +4 −0 examples/ejs/public/stylesheets/style.css
  48. +3 −7 examples/ejs/views/header.html
  49. +2 −2 examples/ejs/views/users.html
  50. +19 −20 examples/error-pages/index.js
  51. +3 −0 examples/error-pages/views/404.ejs
  52. +0 −5 examples/error-pages/views/404.jade
  53. +8 −0 examples/error-pages/views/500.ejs
  54. +0 −13 examples/error-pages/views/500.jade
  55. +0 −6 examples/error-pages/views/error.jade
  56. +10 −0 examples/error-pages/views/error_header.ejs
  57. +2 −0 examples/error-pages/views/footer.ejs
  58. +20 −0 examples/error-pages/views/index.ejs
  59. +0 −15 examples/error-pages/views/index.jade
  60. +0 −6 examples/error-pages/views/layout.jade
  61. +9 −3 examples/error/index.js
  62. +0 −64 examples/expose-data-to-client/index.js
  63. +0 −14 examples/expose-data-to-client/views/page.jade
  64. +3 −1 examples/hello-world/index.js
  65. +0 −51 examples/jade/index.js
  66. +0 −4 examples/jade/public/stylesheets/style.css
  67. +0 −3 examples/jade/views/header.jade
  68. +0 −5 examples/jade/views/layout.jade
  69. +0 −8 examples/jade/views/users/index.jade
  70. +0 −3 examples/jade/views/users/user.jade
  71. +12 −13 examples/markdown/index.js
  72. +15 −0 examples/multi-router/controllers/api_v1.js
  73. +15 −0 examples/multi-router/controllers/api_v2.js
  74. +18 −0 examples/multi-router/index.js
  75. +0 −60 examples/multipart/index.js
  76. +3 −1 examples/mvc/controllers/main/index.js
  77. +4 −0 examples/mvc/controllers/pet/index.js
  78. +17 −0 examples/mvc/controllers/pet/views/edit.ejs
  79. +0 −6 examples/mvc/controllers/pet/views/edit.jade
  80. +15 −0 examples/mvc/controllers/pet/views/show.ejs
  81. +0 −6 examples/mvc/controllers/pet/views/show.jade
  82. +2 −0 examples/mvc/controllers/user-pet/index.js
  83. +4 −0 examples/mvc/controllers/user/index.js
  84. +27 −0 examples/mvc/controllers/user/views/edit.hbs
  85. +0 −11 examples/mvc/controllers/user/views/edit.jade
  86. +18 −0 examples/mvc/controllers/user/views/list.hbs
  87. +0 −7 examples/mvc/controllers/user/views/list.jade
  88. +31 −0 examples/mvc/controllers/user/views/show.hbs
  89. +0 −17 examples/mvc/controllers/user/views/show.jade
  90. +3 −1 examples/mvc/db.js
  91. +9 −9 examples/mvc/index.js
  92. +22 −16 examples/mvc/lib/boot.js
  93. +1 −1 examples/mvc/public/style.css
  94. +13 −0 examples/mvc/views/404.ejs
  95. +0 −3 examples/mvc/views/404.jade
  96. +13 −0 examples/mvc/views/5xx.ejs
  97. +0 −3 examples/mvc/views/5xx.jade
  98. +6 −1 examples/online/index.js
  99. +11 −7 examples/params/{app.js → index.js}
  100. +5 −3 examples/resource/{app.js → index.js}
  101. +7 −4 examples/route-map/index.js
  102. +5 −3 examples/route-middleware/index.js
  103. +18 −8 examples/route-separation/index.js
  104. +2 −0 examples/route-separation/post.js
  105. +3 −1 examples/route-separation/site.js
  106. +7 −3 examples/route-separation/user.js
  107. +2 −0 examples/route-separation/views/footer.ejs
  108. +9 −0 examples/route-separation/views/header.ejs
  109. +10 −0 examples/route-separation/views/index.ejs
  110. +0 −6 examples/route-separation/views/index.jade
  111. +0 −6 examples/route-separation/views/layout.jade
  112. +12 −0 examples/route-separation/views/posts/index.ejs
  113. +0 −8 examples/route-separation/views/posts/index.jade
  114. +23 −0 examples/route-separation/views/users/edit.ejs
  115. +0 −12 examples/route-separation/views/users/edit.jade
  116. +14 −0 examples/route-separation/views/users/index.ejs
  117. +0 −9 examples/route-separation/views/users/index.jade
  118. +9 −0 examples/route-separation/views/users/view.ejs
  119. +0 −6 examples/route-separation/views/users/view.jade
  120. +12 −15 examples/search/index.js
  121. +4 −2 examples/search/{ → public}/client.js
  122. +21 −0 examples/search/public/index.html
  123. +0 −15 examples/search/search.jade
  124. +6 −1 examples/session/index.js
  125. +2 −0 examples/session/redis.js
  126. +6 −3 examples/static-files/index.js
  127. +1 −1 examples/static-files/public/js/app.js
  128. +2 −0 examples/vhost/index.js
  129. +7 −5 examples/view-constructor/github-view.js
  130. +4 −3 examples/view-constructor/index.js
  131. +11 −8 examples/view-locals/index.js
  132. +0 −12 examples/view-locals/layout.jade
  133. +0 −8 examples/view-locals/user.jade
  134. +5 −0 examples/view-locals/user.js
  135. +20 −0 examples/view-locals/views/index.ejs
  136. +19 −12 examples/web-service/index.js
  137. +9 −0 index.js
  138. +273 −190 lib/application.js
  139. +31 −43 lib/express.js
  140. +0 −26 lib/middleware/init.js
  141. +0 −39 lib/middleware/query.js
  142. +180 −116 lib/request.js
  143. +516 −309 lib/response.js
  144. +0 −548 lib/router/index.js
  145. +0 −151 lib/router/layer.js
  146. +0 −61 lib/router/match.js
  147. +0 −175 lib/router/route.js
  148. +126 −111 lib/utils.js
  149. +163 −35 lib/view.js
  150. +67 −48 package.json
  151. +0 −65 support/app.js
  152. +0 −1 support/views/hello.jade
  153. +122 −64 test/Route.js
  154. +289 −79 test/Router.js
  155. +17 −2 test/acceptance/auth.js
  156. +38 −0 test/acceptance/cookie-sessions.js
  157. +8 −13 test/acceptance/cookies.js
  158. +20 −6 test/acceptance/downloads.js
  159. +2 −5 test/acceptance/error-pages.js
  160. +1 −1 test/acceptance/error.js
  161. +21 −0 test/acceptance/hello-world.js
  162. +44 −0 test/acceptance/multi-router.js
  163. +2 −2 test/acceptance/mvc.js
  164. +7 −7 test/acceptance/params.js
  165. +1 −1 test/acceptance/resource.js
  166. +1 −1 test/acceptance/route-map.js
  167. +97 −0 test/acceptance/route-separation.js
  168. +5 −5 test/acceptance/web-service.js
  169. +10 −7 test/app.all.js
  170. +0 −17 test/app.del.js
  171. +16 −13 test/app.engine.js
  172. +9 −11 test/app.head.js
  173. +42 −32 test/app.js
  174. +16 −7 test/app.listen.js
  175. +17 −18 test/app.locals.js
  176. +44 −7 test/app.options.js
  177. +77 −61 test/app.param.js
  178. +144 −64 test/app.render.js
  179. +121 −1 test/app.request.js
  180. +114 −15 test/app.response.js
  181. +135 −0 test/app.route.js
  182. +634 −345 test/app.router.js
  183. +26 −7 test/app.routes.error.js
  184. +289 −12 test/app.use.js
  185. +125 −35 test/config.js
  186. +35 −14 test/exports.js
  187. +754 −0 test/express.json.js
  188. +512 −0 test/express.raw.js
  189. +813 −0 test/express.static.js
  190. +566 −0 test/express.text.js
  191. +827 −0 test/express.urlencoded.js
  192. +1 −0 test/fixtures/% of dogs.txt
  193. +1 −0 test/fixtures/blog/index.html
  194. +0 −1 test/fixtures/blog/post/index.jade
  195. +1 −0 test/fixtures/blog/post/index.tmpl
  196. 0 test/fixtures/broken.send
  197. +1 −0 test/fixtures/default_layout/name.tmpl
  198. +1 −0 test/fixtures/default_layout/user.tmpl
  199. +0 −1 test/fixtures/email.jade
  200. +1 −0 test/fixtures/email.tmpl
  201. 0 test/fixtures/empty.txt
  202. +1 −0 test/fixtures/local_layout/user.tmpl
  203. +0 −1 test/fixtures/name.jade
  204. +1 −0 test/fixtures/name.tmpl
  205. +1 −0 test/fixtures/nums.txt
  206. +0 −1 test/fixtures/pet.jade
  207. +1 −0 test/fixtures/pets/names.txt
  208. 0 test/fixtures/snow ☃/.gitkeep
  209. +1 −0 test/fixtures/todo.html
  210. +1 −0 test/fixtures/todo.txt
  211. +0 −1 test/fixtures/user.jade
  212. +1 −0 test/fixtures/user.tmpl
  213. +1 −0 test/fixtures/users/index.html
  214. +1 −0 test/fixtures/users/tobi.txt
  215. +6 −8 test/middleware.basic.js
  216. +0 −3 test/mocha.opts
  217. +1 −0 test/regression.js
  218. +1 −0 test/req.accepts.js
  219. +0 −49 test/req.acceptsCharset.js
  220. +3 −2 test/req.acceptsCharsets.js
  221. +0 −36 test/req.acceptsEncoding.js
  222. +21 −18 test/req.acceptsEncodings.js
  223. +0 −53 test/req.acceptsLanguage.js
  224. +30 −26 test/req.acceptsLanguages.js
  225. +1 −0 test/req.baseUrl.js
  226. +34 −0 test/req.fresh.js
  227. +27 −2 test/req.get.js
  228. +21 −3 test/req.host.js
  229. +51 −1 test/req.hostname.js
  230. +49 −8 test/req.ip.js
  231. +1 −0 test/req.ips.js
  232. +140 −74 test/req.is.js
  233. +0 −61 test/req.param.js
  234. +1 −0 test/req.path.js
  235. +33 −0 test/req.protocol.js
  236. +88 −19 test/req.query.js
  237. +90 −24 test/req.range.js
  238. +8 −5 test/req.route.js
  239. +18 −0 test/req.secure.js
  240. +3 −6 test/req.signedCookies.js
  241. +14 −0 test/req.stale.js
  242. +77 −6 test/req.subdomains.js
  243. +23 −55 test/req.xhr.js
  244. +116 −0 test/res.append.js
  245. +4 −5 test/res.attachment.js
  246. +31 −10 test/res.clearCookie.js
  247. +165 −43 test/res.cookie.js
  248. +404 −33 test/res.download.js
  249. +68 −18 test/res.format.js
  250. +14 −7 test/res.get.js
  251. +40 −45 test/res.json.js
  252. +99 −102 test/res.jsonp.js
  253. +50 −26 test/res.links.js
  254. +5 −6 test/res.locals.js
  255. +298 −4 test/res.location.js
  256. +101 −55 test/res.redirect.js
  257. +148 −53 test/res.render.js
  258. +206 −187 test/res.send.js
  259. +912 −0 test/res.sendFile.js
  260. +44 −0 test/res.sendStatus.js
  261. +0 −297 test/res.sendfile.js
  262. +64 −20 test/res.set.js
  263. +198 −12 test/res.status.js
  264. +3 −1 test/res.type.js
  265. +67 −32 test/res.vary.js
  266. +1 −1 test/support/env.js
  267. +36 −0 test/support/tmpl.js
  268. +85 −0 test/support/utils.js
  269. +41 −44 test/utils.js
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# https://editorconfig.org
root = true

[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[{*.js,*.json,*.yml}]
indent_size = 2
indent_style = space
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage
node_modules
10 changes: 10 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root: true
env:
es2022: true
node: true
rules:
eol-last: error
eqeqeq: [error, allow-null]
indent: [error, 2, { MemberExpression: "off", SwitchCase: 1 }]
no-trailing-spaces: error
no-unused-vars: [error, { vars: all, args: none, ignoreRestSiblings: true }]
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly

- package-ecosystem: npm
directory: /
schedule:
interval: monthly
time: "23:00"
timezone: Europe/London
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
114 changes: 114 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: ci

on:
push:
branches:
- master
- develop
- '4.x'
- '5.x'
- '5.0'
paths-ignore:
- '*.md'
pull_request:
paths-ignore:
- '*.md'

permissions:
contents: read

# Cancel in progress workflows
# in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run
concurrency:
group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'

- name: Install dependencies
run: npm install --ignore-scripts --include=dev

- name: Run lint
run: npm run lint

test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [18, 19, 20, 21, 22, 23]
# Node.js release schedule: https://nodejs.org/en/about/releases/

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

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Configure npm loglevel
run: |
npm config set loglevel error
shell: bash

- name: Install dependencies
run: npm install

- name: Output Node and NPM versions
run: |
echo "Node.js version: $(node -v)"
echo "NPM version: $(npm -v)"
- name: Run tests
shell: bash
run: npm run test-ci

- name: Upload code coverage
uses: actions/upload-artifact@v4
with:
name: coverage-node-${{ matrix.node-version }}-${{ matrix.os }}
path: ./coverage/lcov.info
retention-days: 1

coverage:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
steps:
- uses: actions/checkout@v4

- name: Install lcov
shell: bash
run: sudo apt-get -y install lcov

- name: Collect coverage reports
uses: actions/download-artifact@v4
with:
path: ./coverage
pattern: coverage-node-*

- name: Merge coverage reports
shell: bash
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info

- name: Upload coverage report
uses: coverallsapp/github-action@v2
with:
file: ./lcov.info
66 changes: 66 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: ["master"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["master"]
schedule:
- cron: "0 0 * * 1"

permissions:
contents: read

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
with:
languages: javascript
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
with:
category: "/language:javascript"
98 changes: 98 additions & 0 deletions .github/workflows/legacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: legacy

on:
push:
branches:
- master
- develop
- '4.x'
- '5.x'
- '5.0'
paths-ignore:
- '*.md'
pull_request:
paths-ignore:
- '*.md'

permissions:
contents: read

# Cancel in progress workflows
# in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run
concurrency:
group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true

jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [16, 17]
# Node.js release schedule: https://nodejs.org/en/about/releases/

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

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Configure npm loglevel
run: |
npm config set loglevel error
shell: bash

- name: Install dependencies
run: npm install

- name: Output Node and NPM versions
run: |
echo "Node.js version: $(node -v)"
echo "NPM version: $(npm -v)"
- name: Run tests
shell: bash
run: npm run test-ci

- name: Upload code coverage
uses: actions/upload-artifact@v4
with:
name: coverage-node-${{ matrix.node-version }}-${{ matrix.os }}
path: ./coverage/lcov.info
retention-days: 1

coverage:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
steps:
- uses: actions/checkout@v4

- name: Install lcov
shell: bash
run: sudo apt-get -y install lcov

- name: Collect coverage reports
uses: actions/download-artifact@v4
with:
path: ./coverage
pattern: coverage-node-*

- name: Merge coverage reports
shell: bash
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info

- name: Upload coverage report
uses: coverallsapp/github-action@v2
with:
file: ./lcov.info
72 changes: 72 additions & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.

name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '16 21 * * 1'
push:
branches: [ "master" ]

# Declare default permissions as read only.
permissions: read-all

jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
# Uncomment the permissions below if installing in a private repository.
# contents: read
# actions: read

steps:
- name: "Checkout code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
with:
results_file: results.sarif
results_format: sarif
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecard on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}

# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
with:
sarif_file: results.sarif
Loading