Skip to content

ci: add PR category enforcement with auto-labeling#6062

Merged
walterbender merged 1 commit intosugarlabs:masterfrom
Ashutoshx7:ci/pr-category-enforcement
Mar 4, 2026
Merged

ci: add PR category enforcement with auto-labeling#6062
walterbender merged 1 commit intosugarlabs:masterfrom
Ashutoshx7:ci/pr-category-enforcement

Conversation

@Ashutoshx7
Copy link
Contributor

@Ashutoshx7 Ashutoshx7 commented Mar 4, 2026

Summary

Added a CI check that requires contributors to select a PR category in the PR template (Bug Fix, Feature, Performance, Tests, Documentation).

  • If no category is selected, the CI fails.
  • When a category is selected, the corresponding label is automatically applied.
  • Works for fork PRs as well.

PR Category

  • Feature — Adds new functionality

Testing (in my fork)

  1. test: add blank line to test PR category CI Ashutoshx7/musicblocks#2 — Fixed issue where the PR template was not loading.
  2. test: minor formatting change to test PR category CI v2 Ashutoshx7/musicblocks#3 — Verified CI fails when no category is selected; fixed label/CI issues after editing the PR.
  3. test: empty commit to test PR category CI v3 Ashutoshx7/musicblocks#4 — Final test: CI fails without category and passes with the correct label when selected.

Screenshots (from my fork)

image

Example Template

  • Bug Fix — Fixes a bug or incorrect behavior
  • Feature — Adds new functionality
  • Performance — Improves performance (load time, memory, rendering, etc.)
  • Tests — Adds or updates test coverage
  • Documentation — Updates to docs, comments, or README

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

✅ All Jest tests passed! This PR is ready to merge.

Add a CI workflow that enforces PR categorization and auto-applies labels.

- Add PR Category section to PR template with 5 categories

- Add GitHub Actions workflow that validates at least one category is checked

- Auto-creates labels with custom colors if they don't exist

- Auto-applies/removes labels based on checked/unchecked categories

- Uses pull_request_target for fork PR compatibility
@Ashutoshx7 Ashutoshx7 force-pushed the ci/pr-category-enforcement branch from d5a093b to 5e8709d Compare March 4, 2026 07:26
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

✅ All Jest tests passed! This PR is ready to merge.

@walterbender walterbender merged commit 9c9732c into sugarlabs:master Mar 4, 2026
7 checks passed
@github-actions github-actions bot added feature Adds new functionality performance Improves performance (load time, memory, rendering) tests Adds or updates test coverage documentation Updates to docs, comments, or README and removed tests Adds or updates test coverage documentation Updates to docs, comments, or README labels Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Adds new functionality performance Improves performance (load time, memory, rendering)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants