Update dependency @types/underscore to v1.11.15 #202
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
permissions: | |
pull-requests: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
benchmark: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- ref: ${{ github.base_ref }} | |
name: base | |
- ref: ${{ github.head_ref }} | |
name: head | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ matrix.ref }} | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "3.2" | |
bundler-cache: true | |
- uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const { issue: { number: issue_number }, repo: { owner, repo } } = context; | |
const { data: comments } = await github.rest.issues.listComments({ owner, repo, issue_number }); | |
const existingComment = comments.find(comment => comment.user.login === "github-actions[bot]" && comment.body.includes("Benchmark result: ${{ matrix.name }}")) | |
const { execSync } = require("child_process"); | |
const result = execSync("bin/benchmark"); | |
const body = ` | |
Benchmark result: ${{ matrix.name }} (${{ matrix.ref }}) | |
\`\`\` | |
${result} | |
\`\`\` | |
`; | |
if (existingComment) { | |
github.rest.issues.updateComment({ owner, repo, body, comment_id: existingComment.id }); | |
} else { | |
github.rest.issues.createComment({ owner, repo, body, issue_number }); | |
} |