Skip to content

Add shared PR Format Check workflow#65

Merged
GoutamD2905 merged 1 commit into
developfrom
feature/pr-lint
Jul 9, 2026
Merged

Add shared PR Format Check workflow#65
GoutamD2905 merged 1 commit into
developfrom
feature/pr-lint

Conversation

@bunnam988

@bunnam988 bunnam988 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a reusable pr-lint.yml shared workflow that validates PR title and description format across all component repos.

What it checks

Title format: TICKET-123 [TICKET-456] : brief description

  • At least one valid ticket number required
  • Multiple tickets supported (e.g. user-story + subtask: RDKCOM-5492 RDKBDEV-3336 : ...)

Description fields (all required, non-empty):

  • Reason for change:
  • Test Procedure:
  • Risks: (value is freeform — e.g. Low / Medium / High)
  • Priority: (value is freeform — e.g. P0 / P1 / P2)

Behavior

  • Fails the check if title or description is missing/incomplete
  • Posts a concise reminder comment on the PR
  • Updates the existing comment on re-edit (no duplicates)
  • Deletes the reminder comment automatically when the PR is fixed
  • ✅ Passes silently when format is correct
  • Works for both same-repo and fork PRs (pull_request_target)
  • Gracefully skips on API failure (never crashes the pipeline)

Usage in component repos

Each repo adds a 9-line caller workflow:

name: PR Format Check
on:
  pull_request_target:
    types: [opened, edited]
jobs:
  lint:
    uses: rdkcentral/build_tools_workflows/.github/workflows/pr-lint.yml@develop

Tested

  • Bad title + missing fields → ❌ fails + reminder comment posted
  • Good title + empty fields → ❌ fails + reminder comment posted
  • Fully correct format → ✅ passes, no comment
  • PR fixed after reminder → comment auto-deleted
  • Re-edit while already commented → comment updated, no duplicate
  • Multiple ticket numbers → passes
  • Bullet / bold / bullet+bold field formats → all detected
  • Fork PRs → comment posted correctly

@bunnam988 bunnam988 requested a review from a team as a code owner July 9, 2026 10:35
Copilot AI review requested due to automatic review settings July 9, 2026 10:35

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

Adds a reusable GitHub Actions workflow (workflow_call) to lint PR title/body formatting and (when non-compliant) post a single reminder comment without blocking merges.

Changes:

  • Introduces .github/workflows/pr-lint.yml reusable workflow to validate PR title ticket format and required PR description fields.
  • Adds logic to post a one-time “PR Format Reminder” comment when formatting issues are detected.

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

Comment thread .github/workflows/pr-lint.yml Outdated
Comment thread .github/workflows/pr-lint.yml
Comment thread .github/workflows/pr-lint.yml Outdated
Copilot AI review requested due to automatic review settings July 9, 2026 10:43

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 1 out of 1 changed files in this pull request and generated 7 comments.

Comment thread .github/workflows/pr-lint.yml Outdated
Comment thread .github/workflows/pr-lint.yml Outdated
Comment thread .github/workflows/pr-lint.yml Outdated
Comment thread .github/workflows/pr-lint.yml Outdated
Comment thread .github/workflows/pr-lint.yml Outdated
Comment thread .github/workflows/pr-lint.yml
Comment thread .github/workflows/pr-lint.yml Outdated
@bunnam988 bunnam988 force-pushed the feature/pr-lint branch 2 times, most recently from c9e23dd to ed62bfd Compare July 9, 2026 10:56
Copilot AI review requested due to automatic review settings July 9, 2026 11:17

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 1 out of 1 changed files in this pull request and generated 3 comments.

Comment thread .github/workflows/pr-lint.yml Outdated
Comment thread .github/workflows/pr-lint.yml
Comment thread .github/workflows/pr-lint.yml Outdated
@bunnam988 bunnam988 force-pushed the feature/pr-lint branch 2 times, most recently from 44f3241 to 01682d5 Compare July 9, 2026 11:46
Copilot AI review requested due to automatic review settings July 9, 2026 11:50

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 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/pr-lint.yml
Comment thread .github/workflows/pr-lint.yml
Copilot AI review requested due to automatic review settings July 9, 2026 11:53

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 1 out of 1 changed files in this pull request and generated 3 comments.

Comment thread .github/workflows/pr-lint.yml
Comment thread .github/workflows/pr-lint.yml
Comment thread .github/workflows/pr-lint.yml
Copilot AI review requested due to automatic review settings July 9, 2026 11:56

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 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/pr-lint.yml
Comment thread .github/workflows/pr-lint.yml
Copilot AI review requested due to automatic review settings July 9, 2026 12:19

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 1 out of 1 changed files in this pull request and generated 3 comments.

Comment thread .github/workflows/pr-lint.yml
Comment thread .github/workflows/pr-lint.yml
Comment thread .github/workflows/pr-lint.yml
…check)

- Validates PR title format: TICKET-123 [TICKET-456] : description
- Validates description contains: Reason for change, Test Procedure, Risks, Priority
- Posts a non-blocking reminder comment if format is missing/incomplete
- Skips duplicate comments on re-edits
- Supports multiple ticket numbers (user-story + subtask)
Copilot AI review requested due to automatic review settings July 9, 2026 12:23

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 1 out of 1 changed files in this pull request and generated 4 comments.

Comment thread .github/workflows/pr-lint.yml
Comment thread .github/workflows/pr-lint.yml
Comment thread .github/workflows/pr-lint.yml
Comment thread .github/workflows/pr-lint.yml
@bunnam988 bunnam988 changed the title Add shared PR lint workflow Add shared PR Format Check workflow Jul 9, 2026
@GoutamD2905 GoutamD2905 merged commit 828d5a5 into develop Jul 9, 2026
8 checks passed
@GoutamD2905 GoutamD2905 deleted the feature/pr-lint branch July 9, 2026 13:18
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants