|
88 | 88 | GITHUB_SHA: ${{ github.sha }} |
89 | 89 | GITHUB_REF_NAME: ${{ github.ref_name }} |
90 | 90 | GITHUB_TOKEN: ${{ github.token }} |
| 91 | + PERFORMANCE_TESTS_TRIGGER_TOKEN: ${{ secrets.PERFORMANCE_TESTS_TRIGGER_TOKEN }} |
91 | 92 | steps: |
92 | 93 | - name: Checkout |
93 | 94 | uses: actions/checkout@v4 |
@@ -218,3 +219,39 @@ jobs: |
218 | 219 | current-run |
219 | 220 | pr-site |
220 | 221 | if-no-files-found: error |
| 222 | + |
| 223 | + - name: Comment benchmark success on triggering PR |
| 224 | + if: success() && env.INPUT_TRIGGER_PR_NUMBER != '' |
| 225 | + uses: actions/github-script@v8 |
| 226 | + with: |
| 227 | + github-token: ${{ secrets.PERFORMANCE_TESTS_TRIGGER_TOKEN }} |
| 228 | + script: | |
| 229 | + const [owner, repo] = process.env.INPUT_TRIGGER_REPOSITORY.split("/"); |
| 230 | + const prNumber = parseInt(process.env.INPUT_TRIGGER_PR_NUMBER, 10); |
| 231 | + const runUrl = `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`; |
| 232 | + await github.rest.issues.createComment({ |
| 233 | + owner, |
| 234 | + repo, |
| 235 | + issue_number: prNumber, |
| 236 | + body: |
| 237 | + "Performance benchmark completed successfully.\n\n" + |
| 238 | + `- [View benchmark results](${runUrl})`, |
| 239 | + }); |
| 240 | +
|
| 241 | + - name: Comment benchmark failure on triggering PR |
| 242 | + if: failure() && env.INPUT_TRIGGER_PR_NUMBER != '' |
| 243 | + uses: actions/github-script@v8 |
| 244 | + with: |
| 245 | + github-token: ${{ secrets.PERFORMANCE_TESTS_TRIGGER_TOKEN }} |
| 246 | + script: | |
| 247 | + const [owner, repo] = process.env.INPUT_TRIGGER_REPOSITORY.split("/"); |
| 248 | + const prNumber = parseInt(process.env.INPUT_TRIGGER_PR_NUMBER, 10); |
| 249 | + const runUrl = `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`; |
| 250 | + await github.rest.issues.createComment({ |
| 251 | + owner, |
| 252 | + repo, |
| 253 | + issue_number: prNumber, |
| 254 | + body: |
| 255 | + "Performance benchmark failed.\n\n" + |
| 256 | + `- [View workflow run](${runUrl})`, |
| 257 | + }); |
0 commit comments