Skip to content

Commit

Permalink
chore: fix bench-main workflow
Browse files Browse the repository at this point in the history
It was using the old signature of the `getStagedFiles` helper function.
  • Loading branch information
aleclarson committed Aug 14, 2024
1 parent 437bdbe commit 5f70b5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/benchmarks/ci-bench-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async function main() {

const benchmarks: Benchmark[] = []

const files = await getStagedFiles(lastBenchedSha, ['src/**/*.ts'])
const files = await getStagedFiles(['src/**/*.ts'], lastBenchedSha)

for (const file of files) {
// Run benchmarks for modified or added source files in a function group
Expand Down
7 changes: 5 additions & 2 deletions scripts/benchmarks/src/getStagedFiles.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { execa } from 'execa'
import { cluster } from 'radashi/array/cluster.js'

export async function getStagedFiles(globs: [string, ...string[]]) {
export async function getStagedFiles(
globs: [string, ...string[]],
baseRef?: string,
) {
const { stdout } = await execa('git', [
'diff',
'--name-status',
'--staged',
...(baseRef ? [`origin/${baseRef}`, 'HEAD'] : ['--staged']),
'--',
...globs,
])
Expand Down

0 comments on commit 5f70b5d

Please sign in to comment.