From f7d64b97e439b5219386b66078977bdf6a52103c Mon Sep 17 00:00:00 2001 From: wagoid <7467450+wagoid@users.noreply.github.com> Date: Mon, 5 Apr 2021 05:13:12 -0300 Subject: [PATCH] chore: test raw commit error --- .github/workflows/commitlint.yml | 4 +++- src/action.js | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 570da6f..0320562 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -1,5 +1,7 @@ name: Commitlint -on: [push, pull_request] +on: + pull_request_target: + branches: main jobs: commitlint: diff --git a/src/action.js b/src/action.js index 43c5aaf..3909a18 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),