Skip to content

Commit

Permalink
Merge pull request #16 from wagoid/fix/add-plugin-with-jira-rules
Browse files Browse the repository at this point in the history
fix: errors not showing when PR has only one commit
  • Loading branch information
wagoid authored Nov 24, 2019
2 parents 526db9a + 8dd0fbf commit 6546e18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,7 +36,7 @@ const getRangeForPushEvent = () => {
from = null
}

if (from === gitEmptySha) {
if (pushEventHasOnlyOneCommit(from)) {
from = null
}

Expand All @@ -58,7 +62,7 @@ const getRangeForEvent = async () => {

function getHistoryCommits(from, to) {
const options = {
from,
from: from && `${from}^1`,
to,
}

Expand Down

0 comments on commit 6546e18

Please sign in to comment.