Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] add workflow to check PR labels #302

Merged
merged 3 commits into from
Feb 9, 2025
Merged

[ci] add workflow to check PR labels #302

merged 3 commits into from
Feb 9, 2025

Conversation

jameslamb
Copy link
Owner

Adds a workflow to enforce that every PR has exactly 1 of the required labels.

To ensure they're all categorized in release notes correctly, matching this:

categories:
- title: '💡 New Features'
label: 'enhancement'
- title: '😬 Breaking'
label: 'breaking'
- title: '🙈 Bug Fixes'
label: 'fix'
- title: '📖 Documentation'
label: 'doc'
- title: '🛠 Maintenance'
label: 'maintenance'

Notes for Reviewers

docs: https://github.com/mheap/github-action-required-labels

@jameslamb
Copy link
Owner Author

jameslamb commented Feb 9, 2025

✅ fails with 0 labels:

Error: Label error. Requires exactly 1 of: breaking, doc, enhancement, fix, maintenance. Found:

https://github.com/jameslamb/pydistcheck/actions/runs/13222997536/job/36910352073?pr=302

@jameslamb jameslamb added the help wanted Extra attention is needed label Feb 9, 2025
@jameslamb
Copy link
Owner Author

✅ fails with 1, incorrect label (triggered by a new commit)

Error: Label error. Requires exactly 1 of: breaking, doc, enhancement, fix, maintenance. Found: help wanted

https://github.com/jameslamb/pydistcheck/actions/runs/13223021215/job/36910400800?pr=302

@jameslamb jameslamb added fix Pull request fixes a bug. breaking Pull request - breaking change. and removed help wanted Extra attention is needed labels Feb 9, 2025
@jameslamb
Copy link
Owner Author

✅ fails with 2, correct labels (triggered by a re-labeling)

Error: Label error. Requires exactly 1 of: breaking, doc, enhancement, fix, maintenance. Found: fix, breaking

https://github.com/jameslamb/pydistcheck/actions/runs/13223051370/job/36910463197?pr=302

And happy to say no other workflows were re-triggered 🎉

@jameslamb jameslamb added maintenance Not a bug or feature and removed fix Pull request fixes a bug. breaking Pull request - breaking change. labels Feb 9, 2025
@jameslamb
Copy link
Owner Author

✅ succeeds with exactly 1 correct label (triggered by a re-labeling)

(no message)

https://github.com/jameslamb/pydistcheck/actions/runs/13223058542/job/36910478084?pr=302

This looks like it's working as advertised. I like it 😁

@jameslamb jameslamb merged commit 2244a8e into main Feb 9, 2025
25 of 30 checks passed
@jameslamb jameslamb deleted the ci/required-labels branch February 9, 2025 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Not a bug or feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant