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

feat: ci: Add PR title check workflow #12339

Closed
wants to merge 4 commits into from
Closed

Conversation

rjan90
Copy link
Contributor

@rjan90 rjan90 commented Aug 5, 2024

Related Issues

Closes: #12148

Proposed Changes

A GitHub Actions workflow to automatically check and enforce a consistent format for PR titles.

Key features of the PR title check workflow:

  1. Runs on pull request events (opened, edited, synchronize, reopened)
  2. Supported types: feat, fix, docs, style, refactor, test, chore
  3. Provides feedback via PR comments for non-compliant titles

This workflow will help maintain consistency in our commit history and make it easier to generate meaningful changelogs automatically.

Testing:

  • Create a PR with a valid title format (e.g., "feat: add new feature")
  • Create a PR with an invalid title format and verify that it's blocked
  • Edit a PR title from invalid to valid format and confirm the check passes
  • Verify that appropriate comments are added for non-compliant titles

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • Update CHANGELOG.md or signal that this change does not need it.
    • If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section.
    • If the change does not require a CHANGELOG.md entry, do one of the following:
      • Add [skip changelog] to the PR title
      • Add the label skip/changelog to the PR
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

rjan90 added 3 commits August 5, 2024 11:06
Add PR title check workflow
Add colon
Request change to PR title instead of blocking PR
Copy link

github-actions bot commented Aug 5, 2024

Your PR title does not match the required format. Please update it to follow this convention: <type>: <scope>: <subject>

Types: feat, fix, docs, style, refactor, test, chore
Scope: required
Subject: start with lowercase

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Please update the PR title to match the required format.

@rjan90
Copy link
Contributor Author

rjan90 commented Aug 5, 2024

Create a PR with an invalid title format and verify that it's blocked

Confirmed that when using an invalid title format: "Add PR title check workflow" - GHA commented that the format does not match the required format. It also requested changes to the PR title to match the required format.

@rjan90 rjan90 changed the title Add PR title check workflow feat: ci: Add PR title check workflow Aug 5, 2024
Remove change requested if title conforms to the formate
@rjan90 rjan90 changed the title feat: ci: Add PR title check workflow Add PR title check workflow Aug 5, 2024
@rjan90 rjan90 changed the title Add PR title check workflow feat: ci: Add PR title check workflow Aug 5, 2024
@rjan90
Copy link
Contributor Author

rjan90 commented Aug 5, 2024

Seems like it's was not able to remove the "requested changes" after updating the PR-title. I have added the logic here 56fbbf6 - will close this PR - and re-open to test out this change.

@rjan90 rjan90 closed this Aug 5, 2024
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.

[DX Streamline] Add mechanism so PR titles conform to repo standard
1 participant