Skip to content
Merged
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
86 changes: 86 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
":dependencyDashboard",
":semanticCommits",
":separatePatchReleases",
"group:allNonMajor"
],
"timezone": "UTC",
"schedule": ["every weekend"],
"labels": ["dependencies"],
"assignees": ["Pmaster-dev"],
"reviewers": ["Pmaster-dev"],
"platformAutomerge": true,
"automerge": true,
"automergeType": "pr",
"prHourlyLimit": 5,
"prConcurrentLimit": 10,
"packageRules": [
{
"description": "Auto-merge patch and minor updates once CI passes",
"matchUpdateTypes": ["patch", "minor"],
"automerge": true,
"automergeType": "pr"
},
{
"description": "Do not auto-merge major updates — require manual review",
"matchUpdateTypes": ["major"],
"automerge": false,
"labels": ["dependencies", "major-update"]
},
{
"description": "Group all non-major GitHub Actions updates",
"matchManagers": ["github-actions"],
"matchUpdateTypes": ["patch", "minor"],
"groupName": "GitHub Actions (non-major)",
"automerge": true
},
{
"description": "Group all non-major Terraform provider updates",
"matchManagers": ["terraform"],
"matchUpdateTypes": ["patch", "minor"],
"groupName": "Terraform providers (non-major)",
"automerge": true
},
{
"description": "Group all frontend workspace updates",
"matchFileNames": ["frontend/package.json"],
"groupName": "frontend dependencies"
},
{
"description": "Group all backend workspace updates",
"matchFileNames": ["backend/package.json"],
"groupName": "backend dependencies"
},
{
"description": "Group DeafAuth service updates",
"matchFileNames": ["Services/deafauth/package.json"],
"groupName": "deafauth dependencies"
},
{
"description": "Group PinkSync service updates",
"matchFileNames": ["Services/pinksync/package.json"],
"groupName": "pinksync dependencies"
},
{
"description": "Group AI workspace updates",
"matchFileNames": ["ai/package.json"],
"groupName": "ai workspace dependencies"
},
{
"description": "Pin GitHub Actions to full SHAs for supply-chain security",
"matchManagers": ["github-actions"],
"pinDigests": true
}
],
"vulnerabilityAlerts": {
"labels": ["security", "dependencies"],
"automerge": true
},
"lockFileMaintenance": {
"enabled": true,
"schedule": ["on the first day of the month"]
}
}
12 changes: 0 additions & 12 deletions .github/workflows/Apply.yml

This file was deleted.

72 changes: 24 additions & 48 deletions .github/workflows/Security-hardening.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,96 +2,72 @@

on:
pull_request:
branches: ['develop']
branches: ['develop', 'main']
push:
branches: ['copilot/*']
branches-ignore:
- docs
branches:
- 'develop'
- 'main'
- 'copilot/**'
schedule:
# Run security checks daily at 2 AM UTC
- cron: '0 2 * * *'

jobs:
# Core security scanning is delegated to the reusable workflow so that
# every workflow that needs npm audit / secret scanning / banned-import
# checks uses the same logic from a single source of truth.
security-audit:
name: Security Audit and Dependency Scan
uses: ./.github/workflows/reusable-security-scan.yml
with:
node_version: '20'
audit_level: 'high'
continue_on_audit_error: true
check_banned_imports: true

# Compliance checks that are specific to this workflow.
compliance-checks:
name: Compliance Checks
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run npm audit
run: |
echo "Running npm audit..."
npm audit --audit-level=high
continue-on-error: false

- name: Check for banned imports in /api
run: |
echo "Checking for banned database imports in /api directory..."
if grep -r "import.*drizzle" ./api/ 2>/dev/null; then
echo "ERROR: Direct drizzle imports found in /api directory"
exit 1
fi
if grep -r "import.*pg\>" ./api/ 2>/dev/null; then
echo "ERROR: Direct pg imports found in /api directory"
exit 1
fi
if grep -r "from ['\"]drizzle" ./api/ 2>/dev/null; then
echo "ERROR: Direct drizzle imports found in /api directory"
exit 1
fi
echo "✓ No banned imports found in /api directory"

- name: Check for committed secrets
run: |
echo "Checking for accidentally committed secrets..."
# Check for common secret patterns
if grep -r "sk_live_" . --exclude-dir=node_modules --exclude-dir=.git 2>/dev/null; then
echo "ERROR: Stripe live secret key found in repository"
exit 1
fi
if grep -r "sk_test_" . --exclude-dir=node_modules --exclude-dir=.git --exclude=".env.example" 2>/dev/null; then
echo "WARNING: Stripe test secret key found - should be in environment variables"
fi
if grep -r "PRIVATE_KEY" . --exclude-dir=node_modules --exclude-dir=.git --exclude="*.md" 2>/dev/null | grep -v "PRIVATE_KEY_PATH"; then
echo "ERROR: Private key found in repository"
exit 1
fi
echo "✓ No obvious secrets found in repository"

- name: Check SECURITY.md exists
run: |
if [ ! -f "SECURITY.md" ]; then
echo "ERROR: SECURITY.md not found in repository root"
exit 1
fi
echo "✓ SECURITY.md exists"

- name: Check agents.md exists
run: |
if [ ! -f "agents.md" ]; then
echo "ERROR: agents.md not found in repository root"
exit 1
echo "WARNING: agents.md not found in repository root"
echo "Consider adding agents.md to document AI agent capabilities and constraints"
else
echo "✓ agents.md exists"
fi
echo "✓ agents.md exists"
continue-on-error: true

- name: Verify TypeScript compilation
run: |
echo "Checking TypeScript compilation..."
npm run check || echo "TypeScript errors found - review before merge"
continue-on-error: true

api-security:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
name: API Security Checks
runs-on: ubuntu-latest

Expand Down Expand Up @@ -188,7 +164,7 @@
summary:
name: Security Check Summary
runs-on: ubuntu-latest
needs: [security-audit, api-security, pii-detection, dependency-pinning, rate-limit-check]
needs: [security-audit, compliance-checks, api-security, pii-detection, dependency-pinning, rate-limit-check]
if: always()

steps:
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
node-version: [20.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
Expand All @@ -37,22 +37,24 @@ jobs:

- name: Generate coverage report
run: npm run test:coverage
continue-on-error: true

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
files: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella
continue-on-error: true

validate-specs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
Expand All @@ -68,10 +70,10 @@ jobs:
needs: [test, validate-specs]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Auto-merge Dependabot PRs

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

permissions:
contents: write
pull-requests: write

jobs:
auto-merge:
name: Auto-merge patch and minor updates
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}

steps:
- name: Fetch Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Enable auto-merge for patch updates
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' }}
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Enable auto-merge for minor updates
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' }}
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading