Skip to content

feat(lint-pr-title): add action to validate PR titles - #82

Merged
chawyehsu merged 4 commits into
ScoopInstaller:mainfrom
chawyehsu:push-wwptmuyynwns
Aug 3, 2026
Merged

feat(lint-pr-title): add action to validate PR titles#82
chawyehsu merged 4 commits into
ScoopInstaller:mainfrom
chawyehsu:push-wwptmuyynwns

Conversation

@chawyehsu

@chawyehsu chawyehsu commented Jul 29, 2026

Copy link
Copy Markdown
Member

Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Summary by CodeRabbit

  • New Features

    • Added automated pull request title validation for Scoop naming conventions.
    • Invalid titles now receive clear formatting guidance, examples, and an error notification.
    • Validation runs automatically for pull request events and confirms accepted titles.
  • Documentation

    • Added guidance covering title format rules, valid examples, manifest naming, versions, and suffixes.
  • Tests

    • Added coverage for valid and invalid title formats, including edge cases and naming restrictions.

Walkthrough

Changes

PR title linting

Layer / File(s) Summary
Title validation contract and implementation
lint-pr-title/PRTitle.ps1, lint-pr-title/README.md
Adds Test-PRTitle, documents accepted formats, and specifies title rules.
Composite action execution flow
lint-pr-title/action.yml, lint-pr-title/README.md
Runs validation for pull request events, reports invalid titles, and documents workflow usage.
Validator test coverage
tests/PRTitle.Tests.ps1
Covers valid formats, invalid manifest names, malformed structures, empty titles, and incompatible suffixes.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description links the pull request to issue #81 but does not explain the changes in meaningful detail. Add a brief summary of the new validation action, title-format support, and associated tests.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly states that the pull request adds an action to validate pull request titles.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2ec02e67-efb0-42c7-90d8-e755b8f898cf

📥 Commits

Reviewing files that changed from the base of the PR and between e174c3b and 2a04a1b.

📒 Files selected for processing (4)
  • lint-pr-title/PRTitle.ps1
  • lint-pr-title/README.md
  • lint-pr-title/action.yml
  • tests/PRTitle.Tests.ps1

Comment thread lint-pr-title/action.yml
Comment thread lint-pr-title/action.yml
Comment thread lint-pr-title/PRTitle.ps1 Outdated
Comment thread lint-pr-title/README.md
Comment on lines +22 to +23
- name: Check PR Title
uses: ScoopInstaller/GithubActions/lint-pr-title@main

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
git ls-remote https://github.com/ScoopInstaller/GithubActions.git refs/heads/main

Repository: ScoopInstaller/GithubActions

Length of output: 223


Pin the documented action reference to a full-length commit SHA.

@main can change after the README is published, so consumers need to review additional action changes. Use the current full SHA, e.g. uses: ScoopInstaller/GithubActions/lint-pr-title@e174c3bef2aeec16a40f2f075cafa167733f0a3e, and update it when the action pin is intentionally upgraded.

@chawyehsu chawyehsu Jul 29, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@coderabbitai Nope, we haven't merged this PR and there's no full SHA for it.

Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new composable composite action (lint-pr-title/) that validates pull request titles against the Scoop bucket PR title convention described in Issue #81, along with PowerShell implementation and Pester tests.

Changes:

  • Added a composite GitHub Action to validate PR titles on pull_request events.
  • Implemented Test-PRTitle PowerShell validation logic and documented expected formats/rules.
  • Added Pester tests to exercise valid/invalid PR title cases.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
lint-pr-title/action.yml Composite action entrypoint that reads PR title and fails the workflow on invalid titles.
lint-pr-title/PRTitle.ps1 PowerShell regex-based PR title validator function (Test-PRTitle).
lint-pr-title/README.md Usage docs and rule summary for downstream consumers of the action.
tests/PRTitle.Tests.ps1 Pester test suite covering valid/invalid PR title examples.
Comments suppressed due to low confidence (1)

tests/PRTitle.Tests.ps1:37

  • This test currently asserts that a manifest name containing a dot ("app.name") is valid, but Issue #81 calls out manifest names as lowercase letters/numbers/hyphens only. This should be an invalid-title test instead (or removed).
        It 'Should accept manifest with dot in name' {
            Test-PRTitle 'app.name@1.0: update' | Should -BeTrue
        }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lint-pr-title/PRTitle.ps1 Outdated
Comment thread tests/PRTitle.Tests.ps1 Outdated
Comment thread lint-pr-title/README.md
Comment thread lint-pr-title/action.yml
Comment thread tests/PRTitle.Tests.ps1 Outdated
chawyehsu and others added 2 commits July 30, 2026 00:27
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (3)

lint-pr-title/PRTitle.ps1:17

  • The regex currently accepts titles where the description is only whitespace (e.g. app-name: ), because the tail : .+ matches spaces. It also allows ) inside the @version segment (@[^^\s:(]+), which can accept malformed titles like app@1.0): .... Tighten the pattern to require a non-whitespace description and exclude both parentheses from the version token.
    if ([string]::IsNullOrEmpty($Title)) { return $false }

    $re = '^(\(chore\)|[a-z0-9]([a-z0-9.-]*[a-z0-9-])?(\(\*\)|\((?=[a-z0-9.-]*[a-z0-9])[a-z0-9.-]*[a-z0-9-]\)|@[^\s:(]+)?): .+'
    return $Title -cmatch $re

tests/PRTitle.Tests.ps1:103

  • There’s no test covering the case where the title has a colon but the description is whitespace-only (e.g. app-name: ). Given the intent is : <description>, this should be rejected and covered by a test so regressions are caught.
        }

        It 'Should reject missing description' {
            Test-PRTitle 'app-name: ' | Should -BeFalse
        }

lint-pr-title/README.md:41

  • The README states the New manifest format must be Add version <version>, but the action implementation only validates the general shape <manifest-name>: <description> and does not enforce a specific phrase. Update the documentation to match the actual validation rules (or update the validator to enforce this rule consistently).
- **New manifest:** `<manifest-name>: Add version <version>`
- **Manifest update:** `<manifest-name>@<version>: <description>`
- **Multi-manifest:** `<manifest-name>(*): <description>` or `<manifest-name>(<suffix>): <description>`
- **Maintenance:** `(chore): <description>`

@chawyehsu

Copy link
Copy Markdown
Member Author

This PR evolves manifest PR title linting from a convention-based prompt into a formal constraint, as part of the effort to alleviate the maintenance burden on buckets. I will merge it if there are no further reviews, or approval from another maintainer. Then promote it to official buckets later after #84. @ScoopInstaller/maintainers

@chawyehsu
chawyehsu merged commit a709983 into ScoopInstaller:main Aug 3, 2026
1 check passed
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.

3 participants