Skip to content

Commit

Permalink
add output as comment
Browse files Browse the repository at this point in the history
  • Loading branch information
f-peverali committed Oct 15, 2024
1 parent bf64b06 commit a1d3e5e
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/test_python_script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,20 @@ jobs:
pip install coverage
coverage run -m unittest discover -s scripts -p 'test*.py'
coverage xml -o coverage/coverage.xml
coverage report
coverage report
- name: Post test results as comment
if: always()
uses: actions/github-script@v4
with:
script: |
const fs = require('fs');
const results = fs.readFileSync('coverage/coverage.xml', 'utf8');
const comment = `## Test Results\n\n\`\`\`xml\n${results}\n\`\`\``;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});

0 comments on commit a1d3e5e

Please sign in to comment.