forked from kuznia-rdzeni/coreblocks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix benchmark workflow (kuznia-rdzeni#670)
- Loading branch information
Jakub Urbańczyk
authored
Apr 22, 2024
1 parent
f12959d
commit 4a08c12
Showing
3 changed files
with
65 additions
and
19 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Publish a PR comment | ||
|
||
on: | ||
workflow_run: | ||
workflows: [Core Benchmarks] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
benchmark-summary: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' }} | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
run-id: ${{ github.event.workflow_run.id }} | ||
github-token: ${{ github.token }} | ||
name: benchmark-summary | ||
path: summary | ||
|
||
- name: 'Comment on PR' | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
let fs = require('fs'); | ||
let issue_number = Number(fs.readFileSync('./summary/pr_number')); | ||
let body = fs.readFileSync('./summary/comment.md', "utf-8"); | ||
await github.rest.issues.createComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: issue_number, | ||
body: body | ||
}); |
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