mirror of
https://github.com/wagoid/commitlint-github-action.git
synced 2025-11-07 16:06:56 +00:00
Merge pull request #19 from wagoid/fix/do-not-get-parent-of-push-before-field
fix: do not try to get parent of push event's "before" field
This commit is contained in:
commit
55cae67a2d
1 changed files with 4 additions and 2 deletions
6
run.js
6
run.js
|
|
@ -56,13 +56,15 @@ const getRangeForEvent = async () => {
|
|||
const commitShas = commits.map(commit => commit.sha)
|
||||
const [from] = commitShas
|
||||
const to = commitShas[commitShas.length - 1]
|
||||
// Git revision range doesn't include the "from" field in "git log", so for "from" we use the parent commit of PR's first commit
|
||||
const fromParent = `${from}^1`
|
||||
|
||||
return [from, to]
|
||||
return [fromParent, to]
|
||||
}
|
||||
|
||||
function getHistoryCommits(from, to) {
|
||||
const options = {
|
||||
from: from && `${from}^1`,
|
||||
from,
|
||||
to,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue