This repository was archived by the owner on Nov 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 github-token :
99 description : " Github token"
1010 required : true
11+ test-command :
12+ description : " Specify a command to run the tests"
13+ required : false
1114runs :
1215 using : " node12"
1316 main : " index.js"
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ const main = async () => {
66 const repoName = context . repo . repo ;
77 const repoOwner = context . repo . owner ;
88 const githubToken = core . getInput ( "github-token" ) ;
9+ const testCommand = core . getInput ( "test-command" ) || "npx jest" ;
910
1011 const githubClient = new GitHub ( githubToken ) ;
1112 const commitPRs = await githubClient . repos . listPullRequestsAssociatedWithCommit (
@@ -17,7 +18,7 @@ const main = async () => {
1718 ) ;
1819 const prNumber = commitPRs . data [ 0 ] . number ;
1920
20- const codeCoverage = execSync ( "npx jest" ) . toString ( ) ;
21+ const codeCoverage = execSync ( testCommand ) . toString ( ) ;
2122 let coveragePercentage = execSync (
2223 "npx coverage-percentage ./coverage/lcov.info --lcov"
2324 ) . toString ( ) ;
Original file line number Diff line number Diff line change @@ -10,10 +10,15 @@ This action comments a pull request with the jest code coverage
1010
1111** Required** Github token.
1212
13+ ### ` test-command `
14+
15+ ** Optional** A custom command to run the tests. (defaults to ` npx jest ` if not specified)
16+
1317## Example usage
1418
1519``` yml
1620uses : ziishaned/jest-reporter-action@v0.0.1
1721with :
18- github-token : ' github-token'
19- ` ` `
22+ github-token : ${{ secrets.GITHUB_TOKEN }}
23+ test-command : " yarn jest --coverage"
24+ ` ` `
You can’t perform that action at this time.
0 commit comments