Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 1

labels:
- label: feature
title: ^feat.*
- label: fix
title: ^fix.*
- label: documentation
title: ^docs.*
- label: cicd
title: ^ci.*
8 changes: 4 additions & 4 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ changelog:
- title: 🐛 Bug Fixes
labels:
- fix
- title: ⬆️ Dependencies
labels:
- dependencies
- title: 📝 Documentation
labels:
- documentation
- title: ⚙️ CI/CD
labels:
- ci/cd
- cicd
- title: ⬆️ Dependencies
labels:
- dependencies
- title: 🧩 Other Changes
labels:
- "*"
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Lint PR

on:
pull_request:
types:
- opened
- edited
branches:
- master
- feature/v3 #TODO: remove

permissions:
pull-requests: write

concurrency:
group: label-pr-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
conventional-pr-title:
if: github.event.action == 'opened' || github.event.action == 'edited' && github.event.changes.title.from
runs-on: ubuntu-latest
steps:
- name: Validate PR title
id: validate-pr-title
uses: amannn/action-semantic-pull-request@v6
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Remove PR labels
run: |
for label in feature fix documentation cicd; do
gh pr edit "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --remove-label "$label" || true
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}

- name: Set PR label
if: steps.validate-pr-title.outputs.error_message == null
uses: srvaroa/labeler@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Comment on PR title lint error
if: steps.validate-pr-title.outputs.error_message
uses: marocchino/sticky-pull-request-comment@v3
with:
header: pr-title-lint-error
recreate: true
message: |
👋 Hey @${{ github.event.pull_request.user.login }}, it looks like the PR title doesn't follow the [Conventional Commits](https://www.conventionalcommits.org) format.

While it's not a blocker for this PR, following the conventional commits format helps us to automatically calculate next release version, categorize changes and generate changelog.

Good candidates might be `feat: ${{ github.event.pull_request.title }}` or `fix: ${{ github.event.pull_request.title }}`. You can also add `!` to indicate a breaking change, e.g. `feat!: ${{ github.event.pull_request.title }}`.

For more details and examples please visit [Conventional Commits](https://www.conventionalcommits.org). 🙌

- name: Remove PR title lint error comment
if: steps.validate-pr-title.outputs.error_message == null
uses: marocchino/sticky-pull-request-comment@v3
with:
header: pr-title-lint-error
delete: true
Loading