process-analytics / icpm-demo-2022

The demo presented at ICPM 2022
https://process-analytics.github.io/icpm-demo-2022/
Apache License 2.0
3 stars 1 forks source link

chore: ensure Pull Request title follows "conventional commits" #51

Closed tbouffard closed 2 years ago

tbouffard commented 2 years ago

closes #35

Rationale

"conventional commits" is a shared practice (https://www.conventionalcommits.org/en/v1.0.0/) and a lot of people are following it. Historically, in PA repositories, we use a custom pattern that is derived from the prefix we use to qualify issues: [FIX], [FEAT], [INFRA], ... (notice that issues use BUG while PR use FIX). As this is custom, even if we document the pattern in the PR Template, external contributors are not following it when they write the PR title and often use "conventional commits" (like in https://github.com/process-analytics/bpmn-visualization-R/pull/117), their own convention or no convention (free style text).

Remember that we use the PR title to create the squash commit to the main branch, so PR title must be consistent.

Enforcing the PR title with a GH workflow ensures that we detect PR titles using a wrong syntax. The GH action used here provides guidance when the title doesn't follow "conventional commits" by creating a PR comment explaining the problem and resolution tips. When the title is correct, the comment is removed keeping the PR timeline cleaned.

This action has already be setup in other repositories of the organization and I would like to generalize that

tbouffard commented 2 years ago

✔️ tested with an invalid title "[INFRA] enforce Pull Request title?" https://github.com/process-analytics/icpm-demo-2022/actions/runs/3298894898/jobs/5441601579

image