diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 570da6f..3cd9bf9 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -1,5 +1,5 @@ name: Commitlint -on: [push, pull_request] +on: [pull_request_target] jobs: commitlint: diff --git a/src/action.js b/src/action.js index 43c5aaf..cdc5cc8 100644 --- a/src/action.js +++ b/src/action.js @@ -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),