Skip to content

Conversation

michelengelen
Copy link
Member

@michelengelen michelengelen commented Feb 27, 2025

This pull request introduces a new GitHub Actions workflow and a supporting script to ensure that pull requests have appropriate type labels. The most important changes include the creation of the workflow file and the implementation of the script to check for type labels.

New workflow for checking PR type labels:

  • .github/workflows/prs_check-if-pr-has-type-label.yml: Added a new workflow to check if pull requests have appropriate type labels. This workflow runs on a PR event and uses the actions/checkout and actions/github-script actions to execute the label checking script.

Implementation of the label checking script:

  • .github/workflows/scripts/prs/checkTypeLabel.js: Added a script that verifies the presence of type labels on pull requests. The script checks for specific labels, creates comments on the PR if the labels are missing or incorrect, and fails the workflow to prevent merging without proper labels.

PRs should be labeled according to their purpose. release, bug/regression and enhancement/new feature should be self explanatory. maintenance is meant to categorize refactors, cleanups and structural changes. dependencies is similar, but not quite the same. We could potentially combine the two into one.

Relates to #206

This commit introduces a GitHub Action to ensure pull requests have exactly one type label. If no label or multiple labels are found, an explanatory comment is left on the PR. This helps standardize PR categorization and improve workflow consistency.

This may as well make the "Check if PR has label" workflow obsolete
Add a `core.setFailed` call to ensure the workflow fails if a PR is merged without valid type labels. This prevents incomplete label verification from being bypassed, ensuring stricter adherence to standards.
This update includes 'dependencies' as an allowed label for PRs. It ensures better categorization and aligns with the labeling standards for managing dependency-related changes.
@michelengelen michelengelen merged commit 5ae0875 into mui:master Feb 28, 2025
7 checks passed
@michelengelen michelengelen deleted the automation/enforce-type-labels-on-prs branch February 28, 2025 10:06
@oliviertassinari oliviertassinari added type: new feature Expand the scope of the product to solve a new problem. scope: support-infra Changes related to the support-infra product. labels Aug 15, 2025
@oliviertassinari oliviertassinari changed the title [infra] Enforce type labels on PRs [support-infra] Enforce type labels on PRs Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: support-infra Changes related to the support-infra product. type: new feature Expand the scope of the product to solve a new problem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants