Add reusable workflow template requiring a Release Drafter category label - #185
Add reusable workflow template requiring a Release Drafter category label#185mikecirioli wants to merge 1 commit into
Conversation
…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
left a comment
There was a problem hiding this comment.
+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
| mode: minimum | ||
| count: 1 |
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
Should explain that this should be kept in synch with
.github/.github/release-drafter.yml
Lines 10 to 67 in bcd538e
There was a problem hiding this comment.
(or actually read that at runtime, if straightforward)
| types: [opened, labeled, unlabeled, synchronize] | ||
|
|
||
| permissions: | ||
| issues: write |
|
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/ |
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-labelsaction andpull_request_targetpattern already proven injenkinsci/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 itsexclude-labels), not the subset jenkins core currently checks against. Core's own list is missingbreaking,major-enhancement,deprecated,enhancement,feature,fix,bugfix,regression,test, andno-changelog— meaning a PR labeled e.g.enhancementthere 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