From 238497d9009f57a081304c2f494b3170062b39b9 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 4 Jul 2024 10:38:47 -0300 Subject: [PATCH] ci: add GitHub Actions workflow for labeling PRs with Conventional Commits (#2522) * feat: Add GitHub Actions workflow for labeling PRs with Conventional Commits * feat(release.yml): add release.yml file with predefined categories for changelog to improve consistency and clarity in release notes * style(release.yml): change 'perf' label to 'performance' for better clarity and consistency across labels in changelog section --- .github/release.yml | 34 +++++++++++++++++++++++ .github/workflows/conventional-labels.yml | 24 ++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/release.yml create mode 100644 .github/workflows/conventional-labels.yml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 000000000..9b53122d8 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,34 @@ +changelog: + categories: + - title: 🚨 Breaking Changes + description: Changes that break existing functionality + labels: + - breaking + - title: ✨ New Features + description: New features and enhancements + labels: + - enhancement + - title: 🐛 Bug Fixes + description: Bug fixes and patches + labels: + - fix + - title: 📝 Documentation Updates + description: Changes to documentation + labels: + - documentation + - title: 🛠 Maintenance Tasks + description: Maintenance tasks and housekeeping + labels: + - chore + - refactor + - style + - performance + - build + - title: ✅ Tests + description: Changes to tests + labels: + - test + - title: Others + description: Other changes + labels: + - "*" diff --git a/.github/workflows/conventional-labels.yml b/.github/workflows/conventional-labels.yml new file mode 100644 index 000000000..7bb581296 --- /dev/null +++ b/.github/workflows/conventional-labels.yml @@ -0,0 +1,24 @@ +# Warning, do not check out untrusted code with +# the pull_request_target event. +name: Label PRs with Conventional Commits +on: + pull_request_target: + types: [ opened, edited , synchronize] + +jobs: + validate-pr: + runs-on: ubuntu-latest + steps: + - name: Validate the pull request + uses: Namchee/conventional-pr@v0.15.4 + with: + access_token: ${{ secrets.GITHUB_TOKEN }} + verbose: true + label: + runs-on: ubuntu-latest + name: Lint PR + steps: + - name: label + uses: action-runner/conventional-labeler@v1 + with: + access_token: ${{ secrets.GITHUB_TOKEN }}