fix(template-require-mandatory-role-attributes): use axobject-query for semantic-role exemptions #343
Workflow file for this run
This file contains hidden or 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
| name: Benchmark Comparison | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| concurrency: | |
| group: bench-${{ github.head_ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| bench-compare: | |
| name: 'Benchmark Comparison' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v6 | |
| id: checkout | |
| with: | |
| # Full history so the script can git-archive the base branch. | |
| fetch-depth: 0 | |
| # Use the PR head SHA so fork PRs resolve correctly | |
| # (github.head_ref is a branch name that only exists on the fork remote). | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - uses: wyvox/action-setup-pnpm@v3 | |
| - name: Run benchmark comparison | |
| env: | |
| BENCH_JSON_OUTPUT: ${{ runner.temp }}/bench-results.json | |
| run: | | |
| set -o pipefail | |
| pnpm bench:compare | sed 's/\x1b\[[0-9;]*m//g' > "$RUNNER_TEMP/bench-output.txt" | |
| - name: Format PR comment | |
| if: always() && steps.checkout.outcome == 'success' | |
| env: | |
| BENCH_OUTPUT_FILE: ${{ runner.temp }}/bench-output.txt | |
| BENCH_JSON_OUTPUT: ${{ runner.temp }}/bench-results.json | |
| BENCH_JOB_SUCCESS: ${{ job.status == 'success' }} | |
| run: node scripts/format-bench-comment.mjs > "$RUNNER_TEMP/bench-comment.md" | |
| - name: Write job summary | |
| if: always() && steps.checkout.outcome == 'success' | |
| run: cat "$RUNNER_TEMP/bench-comment.md" >> "$GITHUB_STEP_SUMMARY" | |
| - name: Post PR comment | |
| if: always() && steps.checkout.outcome == 'success' | |
| uses: actions/github-script@v9 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const marker = '<!-- bench-compare -->'; | |
| const body = fs.readFileSync(process.env.RUNNER_TEMP + '/bench-comment.md', 'utf8'); | |
| const headFullName = context.payload.pull_request?.head?.repo?.full_name; | |
| const isFork = !headFullName || headFullName !== context.repo.owner + '/' + context.repo.repo; | |
| if (isFork) { | |
| core.info('PR is from a fork — skipping PR comment (results are in the job summary).'); | |
| core.info('--- Comment body start ---'); | |
| core.info(body); | |
| core.info('--- Comment body end ---'); | |
| } else { | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| }); | |
| const existing = comments.find(c => c.body.includes(marker)); | |
| if (existing) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: existing.id, | |
| body, | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body, | |
| }); | |
| } | |
| } |