|
47 | 47 | echo "Some benchmark metrics exceed the threshold, please visit the previous step for more information"
|
48 | 48 | exit 1
|
49 | 49 | fi
|
50 |
| - - name: Create Issue on Failure |
51 |
| - if: failure() |
52 |
| - uses: actions/github-script@v7 |
53 |
| - with: |
54 |
| - github-token: ${{ secrets.RSPACK_BOT_ACCESS_TOKEN }} |
55 |
| - script: | |
56 |
| - const diffResult = `${{ steps.monitor.outputs.diff-result }}` |
57 |
| - let result = "task ${{ steps.monitor.outputs.result }}" |
58 |
| - if (diffResult) { |
59 |
| - result = diffResult.replace(/@@/g, "\n"); |
60 |
| - } |
61 |
| - const url = `${context.serverUrl}//${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}` |
62 |
| - const urlLink = `[Open](${url})` |
63 |
| - const date = new Date(); |
64 |
| - const year = date.getFullYear(); |
65 |
| - const month = ('0' + (date.getMonth() + 1)).slice(-2); |
66 |
| - const day = ('0' + date.getDate()).slice(-2); |
67 |
| - const today = `${year}-${month}-${day}` |
68 |
| -
|
69 |
| - const issueTitle = `Benchmark Performance Degradation (${today})` |
70 |
| - const issueBody = ` |
71 |
| - 📝 Benchmark detail: ${urlLink} |
72 |
| -
|
73 |
| - ${result} |
74 |
| - ` |
75 |
| -
|
76 |
| - let repo = context.repo.repo |
77 |
| - const product = "${{ matrix.product }}" |
78 |
| - if (product === "MODERNJS_FRAMEWORK") { |
79 |
| - repo = "modern.js" |
80 |
| - } else if (product === "RSBUILD") { |
81 |
| - repo = "rsbuild" |
82 |
| - } else if (product === "RSPRESS") { |
83 |
| - repo = "rspress" |
84 |
| - } else if (product === "RSLIB") { |
85 |
| - repo = "rslib" |
86 |
| - } |
87 |
| -
|
88 |
| - await github.rest.issues.create({ |
89 |
| - owner: context.repo.owner, |
90 |
| - repo: repo, |
91 |
| - title: issueTitle, |
92 |
| - body: issueBody, |
93 |
| - }); |
0 commit comments