Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
51 changes: 51 additions & 0 deletions .github/changes-filter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# https://github.com/dorny/paths-filter
python:
- "src/**"
- "pyproject.toml"
- "uv.lock"
- "**/test-integration.yml"

frontend:
- "frontend/**"
- "frontend/package.json"
- "frontend/package-lock.json"

docs:
- "docs/**"

docker:
- "docker-compose*.yml"
- "Dockerfile*"
- "uv.lock"
- "pyproject.toml"
- "src/**"
- "frontend/**"
- ".dockerignore"

tests:
- "tests/**"
- "src/**"

api:
- "src/api/**"
- "src/main.py"

services:
- "src/services/**"

connectors:
- "src/connectors/**"

flows:
- "flows/**"

config:
- "config/**"
- "securityconfig/**"

sdks:
- "sdks/**"

scripts:
- "scripts/**"

26 changes: 26 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
frontend:
- changed-files:
- any-glob-to-any-file: 'frontend/**'

backend:
- changed-files:
- any-glob-to-any-file: 'src/**'

documentation:
- changed-files:
- any-glob-to-any-file: 'docs/**'

ci:
- changed-files:
- any-glob-to-any-file: '.github/**'

tests:
- changed-files:
- any-glob-to-any-file: 'tests/**'

docker:
- changed-files:
- any-glob-to-any-file:
- 'Dockerfile*'
- 'docker-compose*.yml'

36 changes: 36 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
changelog:
categories:
- title: 🚨 Breaking Changes
description: Changes that break existing functionality
labels:
- breaking
- title: ✨ New Features
description: New features and enhancements
labels:
- enhancement
- title: πŸ› Bug Fixes
description: Bug fixes and patches
labels:
- fix
- bug
- title: πŸ“ Documentation Updates
description: Changes to documentation
labels:
- documentation
- title: πŸ›  Maintenance Tasks
description: Maintenance tasks and housekeeping
labels:
- chore
- refactor
- style
- performance
- build
- title: βœ… Tests
description: Changes to tests
labels:
- test
- title: Others
description: Other changes
labels:
- "*"

3 changes: 3 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
titleOnly: true
targetUrl: https://www.conventionalcommits.org/en/v1.0.0/#summary

66 changes: 66 additions & 0 deletions .github/workflows/add-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Manage Review Labels

on:
pull_request_review:
types: [submitted]

jobs:
label-on-review:
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: write
steps:
- name: Manage LGTM Review Label
uses: actions/github-script@v8.0
with:
script: |
const LGTM_LABEL = 'lgtm';

// Extract review details
const { state: reviewState } = context.payload.review;
const pullRequestNumber = context.payload.pull_request.number;
const repoDetails = {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullRequestNumber
};

// Log review information
console.log(`Processing review for PR #${pullRequestNumber}`);
console.log(`Review state: ${reviewState}`);

// Helper function to check for LGTM label
async function hasLgtmLabel() {
const { data: labels } = await github.rest.issues.listLabelsOnIssue(repoDetails);
return labels.some(label => label.name === LGTM_LABEL);
}

if (reviewState === 'approved') {
const lgtmExists = await hasLgtmLabel();

if (!lgtmExists) {
console.log(`Adding ${LGTM_LABEL} label to PR #${pullRequestNumber}`);
await github.rest.issues.addLabels({
...repoDetails,
labels: [LGTM_LABEL]
});
console.log('Label added successfully');
} else {
console.log(`${LGTM_LABEL} label already exists`);
}
} else if (reviewState === 'changes_requested') {
const lgtmExists = await hasLgtmLabel();

if (lgtmExists) {
console.log(`Removing ${LGTM_LABEL} label from PR #${pullRequestNumber}`);
await github.rest.issues.removeLabel({
...repoDetails,
name: LGTM_LABEL
});
console.log('Label removed successfully');
} else {
console.log(`No ${LGTM_LABEL} label to remove`);
}
}

39 changes: 39 additions & 0 deletions .github/workflows/auto-delete-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Auto Delete Merged Branch

on:
pull_request:
types: [closed]

jobs:
delete-branch:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Delete merged branch
uses: actions/github-script@v8.0
with:
script: |
const branchName = context.payload.pull_request.head.ref;
const owner = context.repo.owner;
const repo = context.repo.repo;

// Don't delete main/master/develop branches
const protectedBranches = ['main', 'master', 'develop'];
if (protectedBranches.includes(branchName)) {
console.log(`Skipping deletion of protected branch: ${branchName}`);
return;
}

Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

The workflow only checks if the branch name is in the protected branches list, but it doesn't verify if the branch is from a fork. For PRs from forks, the branch deletion will fail because the workflow doesn't have permission to delete branches in the fork repository. Consider adding a check to skip deletion for fork PRs: if (context.payload.pull_request.head.repo.fork) { console.log('Skipping deletion for fork PR'); return; }

Suggested change
// Skip deletion for branches coming from forked repositories
const headRepo = context.payload.pull_request.head.repo;
if (headRepo && headRepo.fork) {
console.log('Skipping deletion for branch from forked repository');
return;
}

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good suggestion

try {
await github.rest.git.deleteRef({
owner,
repo,
ref: `heads/${branchName}`
});
console.log(`Successfully deleted branch: ${branchName}`);
} catch (error) {
console.log(`Could not delete branch ${branchName}: ${error.message}`);
}

30 changes: 30 additions & 0 deletions .github/workflows/community-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Add Community Label

on:
pull_request_target:
# NOTE: pull_request_target is required to have write permissions to add labels on PRs from forks.
# This workflow must not be modified to check out or execute untrusted PR code, as it runs with base repo permissions.
types: [opened]

jobs:
add-label:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Add community label
if: github.event.pull_request.author_association != 'MEMBER' && github.event.pull_request.author_association != 'OWNER' && github.event.pull_request.author_association != 'COLLABORATOR'
uses: actions/github-script@v8.0
with:
script: |
const pullRequestNumber = context.payload.pull_request.number;
const repoDetails = {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullRequestNumber
};
await github.rest.issues.addLabels({
...repoDetails,
labels: ['community']
});

76 changes: 76 additions & 0 deletions .github/workflows/conventional-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# NOTE: pull_request_target is required to have write permissions to add labels on PRs from forks.
# This workflow must not be modified to check out or execute untrusted PR code, as it runs with base repo permissions.
# the pull_request_target event.
name: Label PRs with Conventional Commits
on:
pull_request_target:
types: [opened, edited, synchronize]
merge_group:
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

The merge_group event on line 7 is unusual for this workflow. The workflow validates PR titles and descriptions and adds labels to PRs, but merge groups don't have the same context (no pull_request object). This will cause the workflow to fail when triggered by merge_group events because context.payload.pull_request will be undefined. Consider removing this event trigger or adding conditional logic to handle merge_group events differently.

Suggested change
merge_group:

Copilot uses AI. Check for mistakes.

jobs:
validate-pr-title:
name: Validate PR Title
runs-on: ubuntu-latest
steps:
- name: Validate PR title follows Conventional Commits
id: validate
uses: Namchee/conventional-pr@v0.15
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
issue: false

validate-pr-description:
name: Validate PR Description
runs-on: ubuntu-latest
permissions:
pull-requests: read
steps:
- name: Check PR Description
uses: actions/github-script@v8.0
with:
script: |
const body = context.payload.pull_request.body || '';
const title = context.payload.pull_request.title || '';
const prNumber = context.payload.pull_request.number;

console.log(`Checking PR #${prNumber}: ${title}`);

// Skip validation for bot PRs
if (context.payload.pull_request.user.type === 'Bot') {
console.log('Skipping validation for bot PR');
return;
}

// Check minimum description length (at least 10 characters)
const minLength = 10;
if (body.trim().length < minLength) {
core.setFailed(`PR description is too short. Please provide a meaningful description (at least ${minLength} characters).`);
return;
}

// Check for empty or placeholder descriptions
const placeholderPatterns = [
/^[\s\n]*$/,
/^(n\/a|na|none|no description|todo|tbd|wip)$/i,
/^[\-\*\s]*$/
];

for (const pattern of placeholderPatterns) {
if (pattern.test(body.trim())) {
core.setFailed('PR description appears to be empty or a placeholder. Please provide a meaningful description.');
return;
}
}

console.log('PR description validation passed!');

label:
needs: [validate-pr-title]
name: Label PR
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.type != 'Bot' }}
steps:
- uses: bcoe/conventional-release-labels@v1
with:
type_labels: '{"feat": "enhancement","fix": "bug","docs": "documentation","style": "style","refactor": "refactor","perf": "performance","test": "test","chore": "chore","build": "build"}'

17 changes: 17 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: PR Labeler

on:
pull_request:
types: [opened, synchronize]

jobs:
labeler:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/labeler@v6.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

29 changes: 29 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: PR Title Check

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

jobs:
validate-title:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v6.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
feat
fix
docs
style
refactor
perf
test
build
ci
chore
revert
requireScope: false
subjectPattern: ^.+$

Loading