Skip to content

Commit 7017453

Browse files
authored
chore: ensure that the PR title follows "Conventional Commits" (#224)
Add a dedicated workflow to enforce the rule. It runs on `pull_request_target` to handle PR created by Dependabot and from fork repositories. Dependabot configuration: change PR title prefix. Update the GitHub workflows that create commits and PR. They now follow "conventional commits".
1 parent b2930db commit 7017453

6 files changed

+25
-11
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ updates:
99
versioning-strategy: increase
1010
rebase-strategy: "disabled"
1111
commit-message:
12-
prefix: "[INFRA] deps -"
13-
prefix-development: "[INFRA] dev -"
12+
prefix: "chore(deps)"
13+
prefix-development: "chore(deps-dev)"
1414
labels:
1515
- dependencies
1616
- javascript
@@ -27,7 +27,7 @@ updates:
2727
open-pull-requests-limit: 2
2828
rebase-strategy: "disabled"
2929
commit-message:
30-
prefix: "[INFRA] gha -"
30+
prefix: "chore(gha)"
3131
labels:
3232
- dependencies
3333
- github_actions

.github/workflows/post-release-update_bpmn_visualization_version_in_Examples_repo.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ jobs:
5050
uses: peter-evans/[email protected]
5151
with:
5252
token: ${{ secrets.GH_RELEASE_TOKEN }}
53-
commit-message: "[INFRA] Update bpmn-visualization version to ${{ env.VERSION }}"
53+
commit-message: "chore(deps): update bpmn-visualization version to ${{ env.VERSION }}"
5454
committer: "${{ vars.PA_BOT_NAME }} <${{ vars.PA_BOT_EMAIL }}>"
5555
author: "${{ vars.PA_BOT_NAME }} <${{ vars.PA_BOT_EMAIL }}>"
5656
branch: "infra/update_bpmn_visualization_to_${{ env.VERSION }}"
5757
delete-branch: true
5858
base: "master"
59-
title: "[INFRA] Update bpmn-visualization version to ${{ env.VERSION }}"
59+
title: "chore(deps): update bpmn-visualization version to ${{ env.VERSION }}"
6060
body: "https://cdn.statically.io/gh/process-analytics/bpmn-visualization-examples/infra/update_bpmn_visualization_to_${{ env.VERSION }}/examples/index.html"
6161
labels: "enhancement"
6262
team-reviewers: pa-collaborators

.github/workflows/post-release-update_bpmn_visualization_version_in_R_repo.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ jobs:
4040
uses: peter-evans/[email protected]
4141
with:
4242
token: ${{ secrets.GH_RELEASE_TOKEN }}
43-
commit-message: "[INFRA] Bump bpmn-visualization from ${{ env.OLD_VERSION }} to ${{ env.VERSION }}"
43+
commit-message: "chore(deps): bump bpmn-visualization from ${{ env.OLD_VERSION }} to ${{ env.VERSION }}"
4444
committer: "${{ vars.PA_BOT_NAME }} <${{ vars.PA_BOT_EMAIL }}>"
4545
author: "${{ vars.PA_BOT_NAME }} <${{ vars.PA_BOT_EMAIL }}>"
4646
branch: "infra/bump_bpmn_visualization_from_${{ env.OLD_VERSION }}_to_${{ env.VERSION }}"
4747
delete-branch: true
4848
base: "master"
49-
title: "[INFRA] Bump bpmn-visualization from ${{ env.OLD_VERSION }} to ${{ env.VERSION }}"
49+
title: "chore(deps): bump bpmn-visualization from ${{ env.OLD_VERSION }} to ${{ env.VERSION }}"
5050
body: "Perform what we have to do to update bpmn-visualization-js in the bpmn-visualization-R package. bpmn-visualization is updated from https://cdn.jsdelivr.net/npm/bpmn-visualization@${{ env.VERSION }}/dist/bpmn-visualization.min.js."
5151
labels: "dependencies"
5252
team-reviewers: pa-collaborators
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Check Pull Request Metadata
2+
on:
3+
pull_request_target:
4+
# trigger when the PR title changes
5+
types: [opened, edited, reopened]
6+
7+
jobs:
8+
pr-title:
9+
runs-on: ubuntu-22.04
10+
permissions:
11+
pull-requests: write # post comments when the PR title doesn't match the "Conventional Commits" rules
12+
steps:
13+
- name: Check Pull Request title
14+
uses: bonitasoft/actions/packages/pr-title-conventional-commits@v2

.github/workflows/release-R.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ jobs:
5555
run: |
5656
git add README.md
5757
git add DESCRIPTION
58-
git commit -m "[RELEASE] Set the release version to ${{ steps.release_version.outputs.version }}"
58+
git commit -m "chore(release): set the release version to ${{ steps.release_version.outputs.version }}"
5959
6060
- name: Tag ${{ steps.release_version.outputs.version }}
6161
run: |
62-
git tag -a ${{ steps.release_version.outputs.version_tag }} -m "[RELEASE] ${{ steps.release_version.outputs.version }}"
62+
git tag -a ${{ steps.release_version.outputs.version_tag }} -m "chore(release): ${{ steps.release_version.outputs.version }}"
6363
6464
- name: Update with the development version
6565
run: |-
@@ -68,7 +68,7 @@ jobs:
6868
- name: Commit with the development version
6969
run: |
7070
git add DESCRIPTION
71-
git commit -m "[RELEASE] Set the development version to ${{ steps.release_version.outputs.version }}.9000"
71+
git commit -m "chore(release): set the development version to ${{ steps.release_version.outputs.version }}.9000"
7272
7373
- name: Push commits and tags
7474
run: |

.github/workflows/release-bpmn_visualization.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Checkout master
3838
run: git checkout master && git pull --tags
3939
- name: Bump Version
40-
run: npm version ${{ github.event.inputs.type }} --message "[RELEASE] %s"
40+
run: npm version ${{ github.event.inputs.type }} --message "chore(release) %s"
4141
- name: Push Version
4242
run: git push && git push --tags
4343

0 commit comments

Comments
 (0)