Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @abhijeetviswam
* @abhijeetviswam
44 changes: 44 additions & 0 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: PR Validation

on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]

permissions:
contents: read
pull-requests: read

jobs:
validate:
runs-on: ubuntu-latest

steps:
# 1️⃣ Checkout the PR branch first
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch full history so git log and rebase work

# 2️⃣ Fetch main to rebase
- name: Fetch main branch
run: git fetch origin develop

# 3️⃣ Rebase PR onto main
- name: Rebase on main
run: |
git rebase origin/develop || (
echo "❌ Rebase failed. Please rebase your branch on main." && exit 1
)

# 5️⃣ Check if QA label exists
- name: Check for QA-Approved label
run: |
echo "Checking for QA-Approved label..."
LABELS=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
echo "Labels found: $LABELS"
if [[ "$LABELS" != *"QA-Approved"* ]]; then
echo "❌ Missing QA-Approved label. QA must approve before merge."
exit 1
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}