diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 5d105550..58c3d606 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -9,7 +9,7 @@ jobs: steps: - uses: actions/checkout@v1 - run: sed -i -E "s/([']docker:.+)/Dockerfile/" ./action.yml - - run: echo -n "" > .dockerignore + - run: echo -n '' > .dockerignore - uses: ./ commitlint-with-yml-file: runs-on: ubuntu-latest diff --git a/run.js b/run.js index fc0aea2e..ac36a949 100644 --- a/run.js +++ b/run.js @@ -18,7 +18,11 @@ const configPath = resolve( const { context: eventContext } = github -const gitEmptySha = '0000000000000000000000000000000000000000' +const pushEventHasOnlyOneCommit = from => { + const gitEmptySha = '0000000000000000000000000000000000000000' + + return from === gitEmptySha +} const getRangeForPushEvent = () => { let from = eventContext.payload.before @@ -32,7 +36,7 @@ const getRangeForPushEvent = () => { from = null } - if (from === gitEmptySha) { + if (pushEventHasOnlyOneCommit(from)) { from = null } @@ -58,7 +62,7 @@ const getRangeForEvent = async () => { function getHistoryCommits(from, to) { const options = { - from, + from: from && `${from}^1`, to, }