Skip to content

Commit

Permalink
add pr filter
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Jul 27, 2024
1 parent e7435fa commit 7890404
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ jobs:
- run: npm run test-pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
token: ${{ github.token }}
FORCE_COLOR: true

- name: Generate list using Markdown
run: |
cat docs/pr/coverage-summary.md >> $GITHUB_STEP_SUMMARY
cat docs/pr/coverage-details.md >> $GITHUB_STEP_SUMMARY
15 changes: 9 additions & 6 deletions test/test-pr.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,15 @@ const test = async () => {

outputDir: './docs/pr',

sourceFilter: {
'**/src/**': true
},

onEnd: (coverageResults) => {

sourceFilter: (sourcePath) => {
if (prChanges.length) {
for (const file of prChanges) {
if (sourcePath.includes(file)) {
return true;
}
}
}
return false;
}
};

Expand Down

0 comments on commit 7890404

Please sign in to comment.