beemojs / conventional-pr-action

GitHub Action that validates the PR title and commits against a Conventional Commits preset.
12 stars 3 forks source link

Breaking changes via ! for conventionalcommits preset not recognized #37

Open kenmaca opened 5 months ago

kenmaca commented 5 months ago

First, thanks for creating this Github Action!

I'm getting the following error: Error: PR title doesn't follow conventional changelog format. with the following PR title ci(envs)!: some description here and the following release.yml:

on:
  pull_request:
    types: [opened, edited, synchronize, reopened]
name: ci
jobs:
  conventional-commits:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20.8.1'
      - uses: beemojs/conventional-pr-action@v2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          config-preset: conventionalcommits

I believe I'm setting the preset correctly to conventionalcommits and have also tried auto-install: false with the preset in my devDependencies but still get the same error. Any ideas?

FWIW, I tried conventional-commits-parser on the same commit string via CLI and got the following response:

% conventional-commits-parser
ci(envs)!: some description here

{"type":null,"scope":null,"subject":null,"merge":null,"header":"ci(envs)!: some description here","body":null,"footer":null,"notes":[],"references":[],"mentions":[],"revert":null}

The type: null part is suspect..

milesj commented 5 months ago

@kenmaca It's been a long time since I've worked on this, but if you enable debug logs, does it show anything?

kenmaca commented 5 months ago

How can I enable debug logs? Are you talking about:

Loading preset package
Validating pull request against preset
Error: PR title doesn't follow conventional changelog format.

Also, I wonder if this issue is related, as this action is making use of conventional-commits-parser?

milesj commented 5 months ago

It does look related, but the preset should be able to handle it.

As for debug logs, you can enable debugging when re-running a github job, and there may be a DEBUG env var for the parser, not sure.

milesj commented 1 month ago

@kenmaca Can you try v3 of the action?