Skip to content

Rate Limiting Feature #15

Rate Limiting Feature

Rate Limiting Feature #15

Workflow file for this run

name: Benchmark
on:
pull_request:
branches: [main]
jobs:
benchmark:
name: Benchmark
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == github.repository
permissions:
contents: read
pull-requests: write
issues: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Run benchmarks
id: benchmark
run: |
bun run bench > benchmark-results.txt 2>&1 || true
cat benchmark-results.txt
- name: Comment PR with benchmark results
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const benchmarkResults = fs.readFileSync('benchmark-results.txt', 'utf8');
const comment = '## Benchmark Results\n\n```\n' + benchmarkResults + '\n```';
const params = {
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
};
github.rest.issues.createComment(params);