Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node.js CI
name: Backend Lint
permissions:
contents: read

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint Frontend
name: Frontend Lint

on:
pull_request:
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/pr-title-jira-key-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: PR Title - Jira Key Validation

on:
pull_request:
types: [opened, edited, reopened, synchronize]

jobs:
validate-jira-key-in-pr-title:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
permissions:
pull-requests: write
checks: write
steps:
- name: Check for Jira issue key in PR title
uses: actions/github-script@v7
with:
script: |
const prTitle = context.payload.pull_request.title;
console.log(`PR Title: ${prTitle}`);

// Regex to match Jira issue keys (CDP-123 format)
// Supports conventional commits format: type(CDP-123): description
const jiraKeyRegex = /\b[A-Z]+-\d+\b/;

if (!jiraKeyRegex.test(prTitle)) {
const warningMessage = `⚠️ **Jira Issue Key Missing**

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

**Examples:**
- \`feat: add user authentication (CDP-123)\`
- \`fix(CDP-123): resolve login issue\`

Please add a Jira issue key to your PR title.`;

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: warningMessage
});

// Create check run with failure conclusion
github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
head_sha: context.payload.pull_request.head.sha,
name: 'Jira PR Validation',
status: 'completed',
conclusion: 'neutral',
output: {
title: 'Jira Issue Key Missing',
summary: 'PR title does not contain a Jira issue key'
}
});
} else {
const match = prTitle.match(jiraKeyRegex);
console.log(`✅ Found Jira issue key: ${match[0]}`);

// Create check run with success conclusion
github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
head_sha: context.payload.pull_request.head.sha,
name: 'Jira PR Validation',
status: 'completed',
conclusion: 'success',
output: {
title: 'Jira Issue Key Found',
summary: `Found Jira issue key: ${match[0]}`
}
});
}
38 changes: 0 additions & 38 deletions .github/workflows/release-drafter.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/reset-staging.yaml

This file was deleted.

56 changes: 0 additions & 56 deletions .github/workflows/test-frontend.yml

This file was deleted.

Loading