mirror of
https://github.com/wagoid/commitlint-github-action.git
synced 2025-11-07 16:06:56 +00:00
chore: test raw commit message
This commit is contained in:
parent
ab798dde93
commit
4e180b1878
2 changed files with 5 additions and 1 deletions
2
.github/workflows/commitlint.yml
vendored
2
.github/workflows/commitlint.yml
vendored
|
|
@ -1,5 +1,5 @@
|
|||
name: Commitlint
|
||||
on: [push, pull_request]
|
||||
on: [pull_request_target]
|
||||
|
||||
jobs:
|
||||
commitlint:
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in a new issue