-
Notifications
You must be signed in to change notification settings - Fork 7
feat: add PR title validation workflow #38
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d6a0822
feat: add PR title validation workflow
harshtandiya f373314
chore: add GITHUB_TOKEN to PR title validation workflow
harshtandiya eaecb4f
fix: improve PR title failure message formatting in workflow
harshtandiya ea4c588
chore: update PR title check workflow permissions to include statuses
harshtandiya 3b889f3
chore: update CI workflow to ignore changes in the .github directory
harshtandiya 7c1115e
chore: refine PR title validation workflow by removing unused permiss…
harshtandiya 6fe4e1b
chore: enhance PR title validation workflow by adding 'wip' option
harshtandiya 8ebd82e
chore: update linter workflow to ignore changes in the .github directory
harshtandiya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,8 @@ name: Linters | |
|
|
||
| on: | ||
| pull_request: | ||
| paths-ignore: | ||
| - ".github/**" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| name: PR Title Check | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - synchronize | ||
| - edited | ||
|
|
||
| permissions: | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| validate-pr-title: | ||
| runs-on: ubuntu-slim | ||
| steps: | ||
| - name: Validate PR title | ||
| id: validate | ||
| uses: amannn/action-semantic-pull-request@v6.1.1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| continue-on-error: true | ||
| with: | ||
| # Default types from: https://github.com/commitizen/conventional-commit-types | ||
| requireScope: false | ||
| wip: false | ||
|
|
||
|
|
||
| - name: Print Failure Documentation | ||
| if: steps.validate.outcome == 'failure' | ||
| env: | ||
| PR_TITLE: ${{ github.event.pull_request.title }} | ||
| run: | | ||
| echo "## ❌ PR Title Validation Failed" | ||
| echo "" | ||
| echo "**Current title:** \`$PR_TITLE\`" | ||
| echo "" | ||
| echo "Use a conventional commit style so we can keep a clear history. Fix it like this:" | ||
| echo "" | ||
| echo "### 📋 Format" | ||
| echo "" | ||
| echo "\`type: description\` or \`type(scope): description\`" | ||
| echo "" | ||
| echo "### 🏷️ Allowed types" | ||
| echo "" | ||
| echo "| Type | Use for |" | ||
| echo "|----------|--------|" | ||
| echo "| feat | New feature or user-facing change |" | ||
| echo "| fix | Bug fix |" | ||
| echo "| docs | Documentation only |" | ||
| echo "| style | Formatting, no logic change |" | ||
| echo "| refactor | Code change (no new feature or bug fix) |" | ||
| echo "| perf | Performance improvement |" | ||
| echo "| test | Adding or updating tests |" | ||
| echo "| build | Build system or dependencies |" | ||
| echo "| ci | CI configuration |" | ||
| echo "| chore | Other (maintenance, tooling) |" | ||
| echo "" | ||
| echo "### 🎯 Examples" | ||
| echo "" | ||
| echo "- \`feat: add user authentication\`" | ||
| echo "- \`feat(api): add payment endpoint\`" | ||
| echo "- \`fix: resolve login timeout\`" | ||
| echo "- \`chore: update Python dependencies\`" | ||
| echo "" | ||
| echo "### ❌ Fix these mistakes" | ||
| echo "" | ||
| echo "- \`Add user login\` → \`feat: add user authentication\`" | ||
| echo "- \`Fixed the bug\` → \`fix: resolve checkout error\`" | ||
| echo "- \`feat:add feature\` → \`feat: add feature\` (space after colon)" | ||
| echo "" | ||
| echo "---" | ||
| echo "Edit the PR title and this check will re-run automatically." | ||
| exit 1 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ubuntu-slimis not a valid GitHub-hosted runner label.This will cause the workflow to fail immediately. Use
ubuntu-latest(or a specific version likeubuntu-24.04).Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ubuntu-slim is a valid runner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
💡 Result:
In 2026,
ubuntu-slimis a GitHub-hosted runner label for a single-CPU Ubuntu environment intended for lightweight/short jobs (automation, issue ops), not heavyweight CI builds [1]. It runs in a container (not a full VM) and comes with a minimal preinstalled toolset [1].Specs / limits (standard runners):
How to use:
ubuntu-slimis listed as an Ubuntu Slim (preview) image in theactions/runner-imagesrepo (the source of what’s installed on GitHub-hosted runner images) [2].Sources: GitHub-hosted runners reference [1];
actions/runner-imagesREADME [2].@harshtandiya, you're absolutely correct, and I apologize for the incorrect review comment.ubuntu-slimis indeed a valid GitHub-hosted runner label introduced as a preview feature. It's a single-CPU Ubuntu environment designed specifically for lightweight automation tasks like PR title validation, with these characteristics:This runner is actually well-suited for your PR title validation workflow since it's a lightweight task that doesn't require extensive resources. Thank you for the correction!