diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index b44d298d..cbb7acf2 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -34,7 +34,24 @@ jobs: else pnpm run bench --run --outputJson benchmark.json > benchmark.txt fi + echo 'BENCHMARK_RESULT<> $GITHUB_OUTPUT + sed -i -e '$a\' benchmark.txt + sed -e 's/\x1b\[[0-9;]*m//g' + cat benchmark.txt >> $GITHUB_OUTPUT + echo 'EOF' >> $GITHUB_OUTPUT cat benchmark.txt >> $GITHUB_STEP_SUMMARY + - uses: actions/github-script@v6 + env: + BENCHMARK_RESULT: ${{ steps.benchmark-result.outputs.BENCHMARK_RESULT }} + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: process.env.BENCHMARK_RESULT + }) - run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT id: branch - name: Store benchmark dataq