Skip to content

Commit

Permalink
Change CTest bot to add review
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmacha committed Jun 18, 2024
1 parent 5ab7293 commit b682bcf
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,29 @@ jobs:
script: |
const status = '${{ steps.tests.outputs.tests }}';
const log = '${{ steps.tests.outputs.tests_log }}';
github.rest.issues.createComment({
issue_number: context.issue.number,
const reviews = await github.rest.pulls.listReviews({
pull_number: context.pull.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: (status === 'success' ? '😍 Tests passed!' : '😨 Tests failed!') + '\n\n```\n' + log.replaceAll('%%%', "\n") + '\n```'
})
});
reviews.find(r => r.user.login ==='github-actions' && r.state === 'COMMENTED').forEach(r => {
github.rest.pulls.dismissReview({
pull_number: context.pull.number,
owner: context.repo.owner,
repo: context.repo.repo,
review_id: r.id
});
});
const github.rest.pulls.createReview({
pull_number: context.pull.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: (status === 'success' ? '😍 Tests passed!' : '😨 Tests failed!') + '\n\n```\n' + log.replaceAll('%%%', "\n") + '\n```',
event: (status === 'success' ? 'APPROVE' : 'REQUEST_CHANGES')
});
- name: CMake Install
run: cmake --install out/build/${{ inputs.cmake-preset }} --prefix out/install/${{ inputs.cmake-preset }}
- name: Archive DLL
Expand Down

0 comments on commit b682bcf

Please sign in to comment.