Continuous Benchmark (PR Comment) #785
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: Continuous Benchmark (PR Comment) | |
| on: | |
| workflow_run: | |
| workflows: | |
| - Continuous Benchmark (PR) | |
| types: | |
| - completed | |
| permissions: | |
| actions: read | |
| contents: read | |
| issues: write | |
| # Creating an issue comment on a *pull request* requires pull-requests | |
| # write for the app-scoped GITHUB_TOKEN (issues write only covers actual | |
| # issues); with read the final POST in comment_pr_benchmarks.py 403s. | |
| pull-requests: write | |
| jobs: | |
| benchmark-comment: | |
| name: Publish benchmark PR comment | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download PR benchmark artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| repository: ${{ github.repository }} | |
| run-id: ${{ github.event.workflow_run.id }} | |
| pattern: '*-benchmark-pr-results' | |
| path: benchmark-artifacts | |
| - name: Publish benchmark comment | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| BENCHMARK_RUN_URL: ${{ github.event.workflow_run.html_url }} | |
| run: | | |
| python .github/scripts/comment_pr_benchmarks.py \ | |
| --artifact-root benchmark-artifacts \ | |
| --repository "${{ github.repository }}" \ | |
| --run-url "${BENCHMARK_RUN_URL}" \ | |
| --comment |