Add GitHub workflows and issue templates for copyright protection

- Added copyright check workflow to ensure all files have proper headers
- Added security scan workflow to detect potential vulnerabilities
- Added security issue template for reporting vulnerabilities
- Added copyright violation template for reporting unauthorized use
- Included contact information: radosavlevici.ervin@gmail.com

Copyright (c) 2024 Ervin Remus Radosavlevici
All rights reserved.
This commit is contained in:
ervin remus radosavlevici
2025-05-03 12:17:56 +00:00
parent ade6608dfd
commit 10e839fd12
4 changed files with 182 additions and 0 deletions

54
.github/workflows/copyright-check.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
name: Copyright Check
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
copyright-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check for copyright headers
run: |
echo "Checking for copyright headers in changed files..."
# Get list of changed files
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E '\.(ts|tsx|js|jsx|css|scss)$' || true)
if [ -z "$CHANGED_FILES" ]; then
echo "No relevant files changed."
exit 0
fi
# Check each file for copyright header
MISSING_COPYRIGHT=()
for file in $CHANGED_FILES; do
if [ -f "$file" ]; then
if ! grep -q "Copyright (c) [0-9]\{4\} Ervin Remus Radosavlevici" "$file"; then
MISSING_COPYRIGHT+=("$file")
fi
fi
done
# Report results
if [ ${#MISSING_COPYRIGHT[@]} -ne 0 ]; then
echo "The following files are missing copyright headers:"
for file in "${MISSING_COPYRIGHT[@]}"; do
echo "- $file"
done
echo "Please add the following header to these files:"
echo "/**"
echo " * Copyright (c) 2024 Ervin Remus Radosavlevici"
echo " * All rights reserved."
echo " */"
exit 1
else
echo "All changed files have proper copyright headers."
fi

69
.github/workflows/security-scan.yml vendored Normal file
View File

@@ -0,0 +1,69 @@
name: Security Scan
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
schedule:
- cron: '0 0 * * 0' # Run weekly
jobs:
security-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm ci || npm install
- name: Run npm audit
run: npm audit --audit-level=high
continue-on-error: true
- name: Check for sensitive data
run: |
echo "Checking for sensitive data in repository..."
# Check for potential API keys, tokens, passwords
SENSITIVE_PATTERNS=(
"api[_-]?key"
"auth[_-]?token"
"password"
"secret"
"BEGIN (RSA|DSA|EC|OPENSSH) PRIVATE KEY"
)
FOUND_SENSITIVE=false
for pattern in "${SENSITIVE_PATTERNS[@]}"; do
RESULTS=$(grep -r -i -E "$pattern" --include="*.{js,ts,json,yml,yaml,env}" . || true)
if [ ! -z "$RESULTS" ]; then
echo "⚠️ Potential sensitive data found matching pattern: $pattern"
echo "Please review these files and ensure no secrets are committed."
FOUND_SENSITIVE=true
fi
done
if [ "$FOUND_SENSITIVE" = true ]; then
echo "⚠️ WARNING: Potential sensitive data detected in repository."
echo "This is a security risk. Please review and remove any secrets."
echo "For more information, contact: radosavlevici.ervin@gmail.com"
else
echo "✅ No obvious sensitive data detected."
fi
- name: Security notice
run: |
echo "SECURITY NOTICE"
echo "=============="
echo "This code is protected by copyright law."
echo "Copyright (c) 2024 Ervin Remus Radosavlevici"
echo "All rights reserved."
echo "Contact: radosavlevici.ervin@gmail.com"