Conversation
Benchmark ResultsHyperfine
Criterion |
Benchmark ResultsHyperfine
Criterion |
k88hudson-cfa
left a comment
There was a problem hiding this comment.
There are some security issues here I'm concerned about, if this is the approach you're taking it's critical to maintain principle of least privilege on giving the action permissions. In terms of the artifacts, you could consider this: https://docs.github.com/en/actions/tutorials/store-and-share-data
Benchmark ResultsHyperfine
Criterion |
Benchmark ResultsHyperfine
Criterion |
k88hudson-cfa
left a comment
There was a problem hiding this comment.
R+ with a follow-up: I didn't do thorough comments on the front-end code, but please fix the innerHTML with the unescaped html (in general be careful about using innerHTML)
Some other minor notes that are optional but recommended
| - name: Create JSON results | ||
| if: ${{ github.event.pull_request.base.ref == 'main' }} | ||
| env: |
| } | ||
|
|
||
| const url = source?.url ?? DEFAULT_HISTORY_URL; | ||
| $("meta").innerHTML = `Source: <a href="${url}">${url}</a> · Runs: ${runs.length} · Latest: ${lastTxt}`; |
There was a problem hiding this comment.
This is XSS vulnerable, can you document.createElement("a") and set textContent instead?
| }); | ||
| } else { | ||
| const allWrap = $("tsAllWrap"); | ||
| allWrap.innerHTML = ""; |
There was a problem hiding this comment.
These are OK security wise but you can also use replaceChildren
| } | ||
|
|
||
| function main() { | ||
| const argv = process.argv.slice(2); |
There was a problem hiding this comment.
Modern node has https://nodejs.org/api/util.html#utilparseargsconfig
import {parseArgs} from "node:util";
const { values } = parseArgs({
options: {
repo: { type: "string" },
branch: { type: "string" },
help: { type: "boolean", short: "h" },
},
strict: false,
});| All args are optional except input files; missing inputs produce empty result arrays. | ||
| */ | ||
|
|
||
| 'use strict'; |
There was a problem hiding this comment.
For node 20+ you should use esms
import fs from "node:fs";
import path from "node:path";
No description provided.