Skip to content

ci: add workflow to check for conventional commit PR titles#41

Merged
asasine merged 7 commits intomainfrom
copilot/add-workflow-check-conventional-commit
Mar 24, 2026
Merged

ci: add workflow to check for conventional commit PR titles#41
asasine merged 7 commits intomainfrom
copilot/add-workflow-check-conventional-commit

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

Adds a GitHub Actions workflow to enforce conventional commit format on PR titles using @commitlint/config-conventional, with a comment posted on failure.

Changes Made

  • .github/workflows/conventional-commit.yaml — New workflow triggered on PR opened/edited/synchronize/reopened against main. Installs @commitlint/cli and @commitlint/config-conventional, generates a .commitlintrc.json config inline (no committed config file needed), pipes the PR title through commitlint (with color disabled), and posts a guidance comment with commitlint output on failure. Deduplicates comments by updating existing bot comments. Automatically deletes any outdated failure comment when the title passes validation on a subsequent run.

The edited event type ensures the workflow re-runs automatically when a PR title is changed.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add workflow to check for conventional commit PR titles</issue_title>
<issue_description>If the title does not follow the convention, a comment should be added. The workflow should automatically run again if the title changes.</issue_description>

Comments on the Issue (you are @copilot in this section)


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

@asasine asasine changed the title [WIP] Add workflow to check for conventional commit PR titles ci: add workflow to check for conventional commit PR titles Mar 24, 2026
echo "$PR_TITLE" | npx commitlint --color false 2>&1 | tee /tmp/commitlint-output.txt

- name: Comment on failure
if: failure()
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

If there's already a comment and the workflow runs again, the comment will be left outdated. @copilot what would be a good strategy to handle this outdated comment?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a "Delete outdated comment on success" step that runs when the lint step passes. It finds and deletes any existing bot failure comment, so the PR isn't left with a stale warning after the title is corrected. See 6b75065.

Copilot AI requested a review from asasine March 24, 2026 17:21
@asasine asasine marked this pull request as ready for review March 24, 2026 17:38
@asasine asasine merged commit 17c174a into main Mar 24, 2026
5 checks passed
@asasine asasine deleted the copilot/add-workflow-check-conventional-commit branch March 24, 2026 17:39
@github-actions github-actions bot mentioned this pull request Mar 24, 2026
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.

Add workflow to check for conventional commit PR titles

2 participants