From 447d736f6b67b9415c120ec9e4950c3c84359513 Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Mon, 1 Dec 2025 10:33:10 +0100 Subject: [PATCH 1/4] chore: Add commit_log_patterns to changelog config, remove auto-labeler --- .github/release.yml | 15 ++++--- .github/workflows/pr-labeler.yml | 72 -------------------------------- 2 files changed, 10 insertions(+), 77 deletions(-) delete mode 100644 .github/workflows/pr-labeler.yml diff --git a/.github/release.yml b/.github/release.yml index 72e8208ad1..1b4446a4f4 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -1,8 +1,3 @@ -# This configuration is used by Craft to categorize changelog entries based on -# PR labels. To avoid some manual work, there is a PR labeling GitHub action in -# .github/workflows/pr-labeler.yml that adds a changelog label to PRs based on -# the title. - changelog: exclude: labels: @@ -16,19 +11,29 @@ changelog: - Feature - Improvement - New Integration + commit_log_patterns: + - "^feat(\(\w+\))?:" - title: Bug Fixes 🐛 labels: - "Changelog: Bugfix" - Bug + commit_log_patterns: + - "^(fix|bugfix)(\(\w+\))?:" - title: Deprecations 🏗️ labels: - "Changelog: Deprecation" + commit_log_patterns: + - "deprecat" # deprecation, deprecated - title: Documentation 📚 labels: - "Changelog: Docs" - Docs - "Component: Docs" + commit_log_patterns: + - "^docs(\(\w+\))?:" - title: Internal Changes 🔧 labels: - "Changelog: Internal" - Quality Improvement + commit_log_patterns: + - "^(build|ref|chore|ci|tests)(\(\w+\))?:" diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml deleted file mode 100644 index c489de30d4..0000000000 --- a/.github/workflows/pr-labeler.yml +++ /dev/null @@ -1,72 +0,0 @@ -# This action adds changelog labels to PRs that are then used by the release -# notes generator in Craft. The configuration for which labels map to what -# changelog categories can be found in .github/release.yml. - -name: Label PR for Changelog - -on: - pull_request: - types: [opened, edited] - -permissions: - pull-requests: write - -jobs: - label: - runs-on: ubuntu-latest - steps: - - name: Add changelog label - uses: actions/github-script@v7 - with: - script: | - const title = context.payload.pull_request.title.toLowerCase(); - const prNumber = context.payload.pull_request.number; - - // Get current labels - const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: prNumber, - }); - - // Check if a Changelog label already exists - const hasChangelogLabel = currentLabels.some(label => - label.name.startsWith('Changelog:') || label.name === 'skip-changelog' - ); - - if (hasChangelogLabel) { - console.log('PR already has a Changelog label, skipping'); - return; - } - - // Determine which label to apply - let newLabel = null; - - if (title.includes('deprecate')) { - newLabel = 'Changelog: Deprecation'; - } else if (title.startsWith('feat')) { - newLabel = 'Changelog: Feature'; - } else if (title.startsWith('fix') || title.startsWith('bugfix')) { - newLabel = 'Changelog: Bugfix'; - } else if (title.startsWith('docs')) { - newLabel = 'Changelog: Docs'; - } else if (title.startsWith('ref') || title.startsWith('test')) { - newLabel = 'Changelog: Internal'; - } else if (title.startsWith('ci') || title.startsWith('build')) { - newLabel = 'skip-changelog'; - } - - // Apply the new label if one was determined - if (newLabel) { - await github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: prNumber, - labels: [newLabel], - }); - - console.log(`Applied label: ${newLabel}`); - } else { - console.log('No matching label pattern found in PR title, please add manually'); - } - From 1edd100928caee1f7bc5d4f7f1e221a88b38b77e Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Mon, 1 Dec 2025 10:41:15 +0100 Subject: [PATCH 2/4] add test, too --- .github/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/release.yml b/.github/release.yml index 1b4446a4f4..0f5a81b30d 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -36,4 +36,4 @@ changelog: - "Changelog: Internal" - Quality Improvement commit_log_patterns: - - "^(build|ref|chore|ci|tests)(\(\w+\))?:" + - "^(build|ref|chore|ci|tests|test)(\(\w+\))?:" From 2dc22270cbabc26a9fa43aaad19f704e60f0d847 Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Mon, 1 Dec 2025 10:52:50 +0100 Subject: [PATCH 3/4] allow hyphens --- .github/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/release.yml b/.github/release.yml index 0f5a81b30d..5d99cb98f6 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -12,13 +12,13 @@ changelog: - Improvement - New Integration commit_log_patterns: - - "^feat(\(\w+\))?:" + - "^feat(\([a-zA-Z0-9_-]+\))?:" - title: Bug Fixes 🐛 labels: - "Changelog: Bugfix" - Bug commit_log_patterns: - - "^(fix|bugfix)(\(\w+\))?:" + - "^(fix|bugfix)(\([a-zA-Z0-9_-]+\))?:" - title: Deprecations 🏗️ labels: - "Changelog: Deprecation" @@ -30,10 +30,10 @@ changelog: - Docs - "Component: Docs" commit_log_patterns: - - "^docs(\(\w+\))?:" + - "^docs(\([a-zA-Z0-9_-]+\))?:" - title: Internal Changes 🔧 labels: - "Changelog: Internal" - Quality Improvement commit_log_patterns: - - "^(build|ref|chore|ci|tests|test)(\(\w+\))?:" + - "^(build|ref|chore|ci|tests|test)(\([a-zA-Z0-9_-]+\))?:" From cba05aeda0cf32042922dfa21eb8b92522f006dc Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Mon, 1 Dec 2025 14:14:03 +0100 Subject: [PATCH 4/4] new name --- .github/release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/release.yml b/.github/release.yml index 5d99cb98f6..37ec0bb752 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -11,29 +11,29 @@ changelog: - Feature - Improvement - New Integration - commit_log_patterns: + commit_patterns: - "^feat(\([a-zA-Z0-9_-]+\))?:" - title: Bug Fixes 🐛 labels: - "Changelog: Bugfix" - Bug - commit_log_patterns: + commit_patterns: - "^(fix|bugfix)(\([a-zA-Z0-9_-]+\))?:" - title: Deprecations 🏗️ labels: - "Changelog: Deprecation" - commit_log_patterns: + commit_patterns: - "deprecat" # deprecation, deprecated - title: Documentation 📚 labels: - "Changelog: Docs" - Docs - "Component: Docs" - commit_log_patterns: + commit_patterns: - "^docs(\([a-zA-Z0-9_-]+\))?:" - title: Internal Changes 🔧 labels: - "Changelog: Internal" - Quality Improvement - commit_log_patterns: + commit_patterns: - "^(build|ref|chore|ci|tests|test)(\([a-zA-Z0-9_-]+\))?:"