File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,11 +120,10 @@ const handleOnlyWarnings = formattedResults => {
120120}
121121
122122const showLintResults = async ( [ from , to ] ) => {
123- const failOnWarnings = core . getInput ( 'failOnWarnings' )
124123 const commits = await getHistoryCommits ( from , to )
125124 const config = existsSync ( configPath )
126125 ? await load ( { } , { file : configPath } )
127- : { }
126+ : await load ( { extends : [ '@commitlint/config-conventional' ] } )
128127 const opts = getOptsFromConfig ( config )
129128 const lintedCommits = await Promise . all (
130129 commits . map ( async commit => ( {
Original file line number Diff line number Diff line change @@ -60,6 +60,20 @@ describe('Commit Linter action', () => {
6060 jest . resetModules ( )
6161 } )
6262
63+ it ( 'should use default config when config file does not exist' , async ( ) => {
64+ td . when ( core . getInput ( 'configFile' ) ) . thenReturn ( './not-existing-config.js' )
65+ cwd = await git . bootstrap ( 'fixtures/conventional' )
66+ await gitEmptyCommit ( cwd , 'wrong message' )
67+ const [ to ] = await getCommitHashes ( cwd )
68+ await createPushEventPayload ( cwd , { to } )
69+ updatePushEnvVars ( cwd , to )
70+ td . replace ( process , 'cwd' , ( ) => cwd )
71+
72+ await runAction ( )
73+
74+ td . verify ( core . setFailed ( contains ( 'You have commit messages with errors' ) ) )
75+ } )
76+
6377 it ( 'should fail for single push with incorrect message' , async ( ) => {
6478 cwd = await git . bootstrap ( 'fixtures/conventional' )
6579 await gitEmptyCommit ( cwd , 'wrong message' )
You can’t perform that action at this time.
0 commit comments