Skip to content

feat: Add cocogitto conventional commits check#67

Merged
berkus merged 1 commit into
masterfrom
feat/conv-commits-check
Mar 8, 2026
Merged

feat: Add cocogitto conventional commits check#67
berkus merged 1 commit into
masterfrom
feat/conv-commits-check

Conversation

@berkus

@berkus berkus commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

Check PR commits are compliant, so we can generate changelogs automagically.

Check PR commits are compliant, so we can generate changelogs automagically.
@berkus berkus self-assigned this Mar 8, 2026
Copilot AI review requested due to automatic review settings March 8, 2026 22:59
@berkus berkus enabled auto-merge (rebase) March 8, 2026 23:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Cocogitto-based conventional commit check to pull requests so commit messages can be validated consistently and used for changelog generation.

Changes:

  • Add a cog.toml Cocogitto configuration (tag prefix, merge-commit ignore, custom commit types).
  • Add a GitHub Actions workflow to run cog check against PR commits.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
cog.toml Introduces Cocogitto configuration used by CI to validate/interpret commit messages.
.github/workflows/cog.yaml Adds a PR workflow that checks commit message compliance via cocogitto-action.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +18 to +25
fetch-depth: 0
# pick the pr HEAD instead of the merge commit
ref: ${{github.event.pull_request.head.sha}}
- name: Conventional commit check
uses: cocogitto/cocogitto-action@v4.1.0
with:
command: check
args: ${{github.event.pull_request.base.sha}}..${{github.event.pull_request.head.sha}}

Copilot AI Mar 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions/checkout is pinned to the PR head SHA, but the cog check range references ${{ github.event.pull_request.base.sha }} as well. If the PR branch is behind the base branch, that base SHA may not exist in the checked-out repository, causing cog/git to fail resolving the range. Consider explicitly fetching the base ref/SHA (or computing the merge-base between base and head) before running the check so the revision range is always available.

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +25
uses: actions/checkout@v6.0.2
with:
fetch-tags: true
fetch-depth: 0
# pick the pr HEAD instead of the merge commit
ref: ${{github.event.pull_request.head.sha}}
- name: Conventional commit check
uses: cocogitto/cocogitto-action@v4.1.0
with:
command: check
args: ${{github.event.pull_request.base.sha}}..${{github.event.pull_request.head.sha}}

Copilot AI Mar 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow uses ${{github.*}} expressions without the spacing used elsewhere in this repo (e.g., ${{ github.* }} in .github/workflows/ci.yaml) and pins actions/checkout to v6.0.2 while other workflows use actions/checkout@v6. Aligning these improves consistency and avoids relying on a potentially non-existent patch tag.

Suggested change
uses: actions/checkout@v6.0.2
with:
fetch-tags: true
fetch-depth: 0
# pick the pr HEAD instead of the merge commit
ref: ${{github.event.pull_request.head.sha}}
- name: Conventional commit check
uses: cocogitto/cocogitto-action@v4.1.0
with:
command: check
args: ${{github.event.pull_request.base.sha}}..${{github.event.pull_request.head.sha}}
uses: actions/checkout@v6
with:
fetch-tags: true
fetch-depth: 0
# pick the pr HEAD instead of the merge commit
ref: ${{ github.event.pull_request.head.sha }}
- name: Conventional commit check
uses: cocogitto/cocogitto-action@v4.1.0
with:
command: check
args: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}

Copilot uses AI. Check for mistakes.
@berkus berkus merged commit 78283a8 into master Mar 8, 2026
12 checks passed
@berkus berkus deleted the feat/conv-commits-check branch March 8, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants