5
0
Fork 0
mirror of https://github.com/wagoid/commitlint-github-action.git synced 2025-11-07 16:06:56 +00:00

chore: test raw commit error

This commit is contained in:
wagoid 2021-04-05 05:13:12 -03:00
parent 4fbd5beb47
commit 9028967066
2 changed files with 5 additions and 1 deletions

View file

@ -1,5 +1,5 @@
name: Commitlint
on: [push, pull_request]
on: [pull_request_target]
jobs:
commitlint:

View file

@ -1,5 +1,6 @@
const { existsSync } = require('fs')
const { resolve } = require('path')
const { inspect } = require('util')
const core = require('@actions/core')
const github = require('@actions/github')
const lint = require('@commitlint/lint').default
@ -25,6 +26,8 @@ const pushEventHasOnlyOneCommit = (from) => {
return from === gitEmptySha
}
console.log(inspect(eventContext)
const getRangeForPushEvent = () => {
let from = eventContext.payload.before
const to = GITHUB_SHA
@ -125,6 +128,7 @@ const showLintResults = async ([from, to]) => {
? await load({}, { file: configPath })
: await load({ extends: ['@commitlint/config-conventional'] })
const opts = getOptsFromConfig(config)
console.log(inspect(commits)
const lintedCommits = await Promise.all(
commits.map(async (commit) => ({
lintResult: await lint(commit.message, config.rules, opts),