wagoid/commitlint-github-action

error in v5.4.2

jinganix opened this issue · 3 comments

There are two workflows PR and CI in the repo: https://github.com/jinganix/ddz/actions

CI: https://github.com/jinganix/ddz/blob/master/.github/workflows/ci.yml
PR: https://github.com/jinganix/ddz/blob/master/.github/workflows/pr.yml

PR workflow works fine in v5.4.1 and v5.4.2:

CI workflow works fine in v5.4.1, but fails in v5.4.2:

The error message is:

Error: You have commit messages with errors

error trying to get list of pull request's commits
Cannot read property 'map' of undefined
TypeError: Cannot read property 'map' of undefined
    at getPushEventCommits (/run.js:57:56)
    at getEventCommits (/run.js:65:62)
    at commitLinterAction (/run.js:166:34)
    at Object.<anonymous> (/run.js:168:1)
    at Module._compile (node:internal/modules/cjs/loader:[10](https://github.com/jinganix/ddz/actions/runs/5632512219/job/15264988759#step:4:11)95:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:[11](https://github.com/jinganix/ddz/actions/runs/5632512219/job/15264988759#step:4:12)24:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:816:[12](https://github.com/jinganix/ddz/actions/runs/5632512219/job/15264988759#step:4:13))
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
    at node:internal/main/run_main_module:[17](https://github.com/jinganix/ddz/actions/runs/5632512219/job/15264988759#step:4:18):47
Error: You have commit messages with errors

The CI works fine again if I specify the version: uses: wagoid/commitlint-github-action@v5.4.1:

The error also occurred in another repo

wagoid commented

Hi @jinganix! I think that's because you have scheduled commits, let me throw a quick fix

wagoid commented

Issue fixed @jinganix, let me know if it still persists 💪

it works fine now, thanks