Skip to content

Add reusable workflow template requiring a Release Drafter category label - #185

Draft
mikecirioli wants to merge 1 commit into
jenkinsci:masterfrom
mikecirioli:require-category-label-check
Draft

Add reusable workflow template requiring a Release Drafter category label#185
mikecirioli wants to merge 1 commit into
jenkinsci:masterfrom
mikecirioli:require-category-label-check

Conversation

@mikecirioli

@mikecirioli mikecirioli commented Aug 25, 2026

Copy link
Copy Markdown

Summary

Adds a new opt-in workflow template, require-category-label.yaml, that fails a PR check when it has no label matching a Release Drafter category. Follow-up to jenkins-infra/interesting-category-action#1 (uncategorized PRs showing up in generated changelogs, e.g. https://github.com/jenkinsci/support-core-plugin/releases/tag/1858.vd36229d021b_8).

Approach

Reuses the same mheap/github-action-required-labels action and pull_request_target pattern already proven in jenkinsci/jenkins's own .github/workflows/require-changelog-label.yml, rather than building a new custom Action (per the "find or create" framing in the linked issue).

One difference from that existing workflow: the label list here is the full set of categories from this org's release-drafter.yml (plus its exclude-labels), not the subset jenkins core currently checks against. Core's own list is missing breaking, major-enhancement, deprecated, enhancement, feature, fix, bugfix, regression, test, and no-changelog — meaning a PR labeled e.g. enhancement there would still be flagged as missing a label. Filed as a template here so any repo can opt in without every repo hand-rolling its own copy.

Test plan

  • Confirm template renders correctly in the Actions "new workflow" picker
  • Manually verify on a scratch repo: PR with no label fails the check; adding a recognized label (via the UI, not just at open) flips it to passing

…abel

Follows up on jenkins-infra/interesting-category-action#1: PRs merged
without a category label (bug, enhancement, chore, etc.) show up as
uncategorized in Release Drafter's generated changelog. This adds a
required check, reusing the same mheap/github-action-required-labels
pattern already proven in jenkinsci/jenkins's own
require-changelog-label.yml, but against the full label set from this
org's release-drafter.yml categories (jenkins core's own version is
missing several categories, e.g. enhancement/feature/breaking).

@oleg-nenashev oleg-nenashev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 as long as it is opt-in.
It would be also nice to add the new option to https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc

Comment on lines +18 to +19
mode: minimum
count: 1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to also fail if there are more than one such label.

This is a pretty simple piece of logic that would probably be better written using gh CLI rather than some third-party action.

Comment on lines +23 to +47
breaking
removed
major-enhancement
major-rfe
major-bug
deprecated
enhancement
feature
rfe
bug
fix
bugfix
regression
regression-fix
localization
developer
documentation
chore
internal
maintenance
test
tests
dependencies
no-changelog
skip-changelog

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should explain that this should be kept in synch with

categories:
- title: 💥 Breaking changes
labels:
- breaking
- title: 🚨 Removed
labels:
- removed
- title: 🎉 Major features and improvements
labels:
- major-enhancement
- major-rfe
- title: 🐛 Major bug fixes
labels:
- major-bug
- title: ⚠️ Deprecated
labels:
- deprecated
- title: 🚀 New features and improvements
labels:
- enhancement
- feature
- rfe
- title: 🐛 Bug fixes
labels:
- bug
- fix
- bugfix
- regression
- regression-fix
- title: 🌐 Localization and translation
labels:
- localization
- title: 👷 Changes for plugin developers
labels:
- developer
- title: 📝 Documentation updates
labels:
- documentation
- title: 👻 Maintenance
labels:
- chore
- internal
- maintenance
- title: 🚦 Tests
labels:
- test
- tests
- title: ✍ Other changes
# Default label used by Dependabot
- title: 📦 Dependency updates
labels:
- dependencies
collapse-after: 15
exclude-labels:
- reverted
- no-changelog
- skip-changelog
- invalid

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(or actually read that at runtime, if straightforward)

types: [opened, labeled, unlabeled, synchronize]

permissions:
issues: write

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

@jglick

jglick commented Aug 26, 2026

Copy link
Copy Markdown
Member

Of course the workflow (after some testing) should be added to https://github.com/jenkinsci/archetypes/tree/master/common-files/.github/workflows and recommended in https://www.jenkins.io/doc/developer/publishing/releasing-cd/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants