Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: wagoid/commitlint-github-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.0
Choose a base ref
...
head repository: wagoid/commitlint-github-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.0.1
Choose a head ref
  • 3 commits
  • 6 files changed
  • 1 contributor

Commits on Aug 20, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0911cae View commit details
  2. Merge pull request #44 from wagoid/fix/action-showing-error-output-wh…

    …en-not-all-commits-have-warnings
    
    fix: action shows error ouput when not all commits have warnings
    wagoid authored Aug 20, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    34cc853 View commit details
  3. chore(release): publish

    wagoid committed Aug 20, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1ffd33d View commit details
Showing with 22 additions and 8 deletions.
  1. +6 −0 CHANGELOG.md
  2. +1 −1 action.yml
  3. +1 −1 package-lock.json
  4. +1 −1 package.json
  5. +2 −3 src/action.js
  6. +11 −2 src/action.test.js
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [2.0.1](https://github.com/wagoid/commitlint-github-action/compare/v2.0.0...v2.0.1) (2020-08-20)

### Bug Fixes

- action shows error ouput when not all commits have warnings ([0911cae](https://github.com/wagoid/commitlint-github-action/commit/0911cae00990e44bafab30af5357ed057b5cf964)), closes [#43](https://github.com/wagoid/commitlint-github-action/issues/43)

# [2.0.0](https://github.com/wagoid/commitlint-github-action/compare/v1.8.0...v2.0.0) (2020-08-02)

### Features
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ outputs:
description: The error and warning messages for each one of the analyzed commits
runs:
using: 'docker'
image: 'docker://wagoid/commitlint-github-action:2.0.0'
image: 'docker://wagoid/commitlint-github-action:2.0.1'
branding:
icon: 'check-square'
color: 'blue'
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "commitlint-github-action",
"version": "2.0.0",
"version": "2.0.1",
"description": "commitlint github action",
"main": "index.js",
"scripts": {
5 changes: 2 additions & 3 deletions src/action.js
Original file line number Diff line number Diff line change
@@ -104,9 +104,8 @@ const formatErrors = lintedCommits =>

const hasOnlyWarnings = lintedCommits =>
lintedCommits.length &&
lintedCommits.every(
({ lintResult }) => lintResult.valid && lintResult.warnings.length,
)
lintedCommits.every(({ lintResult }) => lintResult.valid) &&
lintedCommits.some(({ lintResult }) => lintResult.warnings.length)

const setFailed = formattedResults => {
core.setFailed(`You have commit messages with errors\n\n${formattedResults}`)
13 changes: 11 additions & 2 deletions src/action.test.js
Original file line number Diff line number Diff line change
@@ -400,12 +400,14 @@ describe('Commit Linter action', () => {

beforeEach(async () => {
cwd = await git.bootstrap('fixtures/conventional')
await gitEmptyCommit(cwd, 'chore: previous commit')
await gitEmptyCommit(cwd, 'chore: correct message with no warnings')
await gitEmptyCommit(
cwd,
'chore: correct message\nsome context without leading blank line',
)
const [to] = await getCommitHashes(cwd)
await createPushEventPayload(cwd, { to })
const [before, from, to] = await getCommitHashes(cwd)
await createPushEventPayload(cwd, { before, to })
updatePushEnvVars(cwd, to)
td.replace(process, 'cwd', () => cwd)
td.replace(console, 'log')
@@ -419,6 +421,13 @@ describe('Commit Linter action', () => {
errors: [],
warnings: ['body must have leading blank line'],
},
{
hash: from,
message: 'chore: correct message with no warnings',
valid: true,
errors: [],
warnings: [],
},
]
})