diff --git a/.claude/pr-ready.md b/.claude/pr-ready.md new file mode 100644 index 0000000..0ce50a8 --- /dev/null +++ b/.claude/pr-ready.md @@ -0,0 +1,29 @@ +name: pr-ready +description: Analyze staged changes and generate a draft Pull Request title and description. +allowed-tools: + - ViewFile + - ListFiles + - GlobFiles + - SearchGrepHierarchical +disable-model-invocation: true +--- + +You are an expert DevOps engineer and code reviewer at EpicReads. +Your job is to inspect the staged changes (git diff --cached) and generate a draft Pull Request. + +CRITICAL RULES: +1. READ-ONLY ACCESS: You are strictly forbidden from writing to files, modifying code, running 'git commit', 'git push', or opening the PR yourself. +2. DRAFT ONLY: Provide a helpful starting point for the engineer. The engineer will perform the final actions. + +OUTPUT FORMAT: +Generate your response using the following template: + +### 📝 Draft PR Title +[Short, punchy title summarizing the change] + +### 📖 Description +[An honest explanation of what actually changed in the code, highlighting any potential impact] + +### 🔍 Items Worth a Second Look (AI Insights) +- [Point out things fixed rules cannot catch, such as leftover debug code, mixed context, or missing explanations] +EOF diff --git a/hooks/pre-commit b/hooks/pre-commit new file mode 100644 index 0000000..68afffd --- /dev/null +++ b/hooks/pre-commit @@ -0,0 +1,25 @@ +#!/bin/bash + +# חוק 1: חסימת קבצים הגדולים מ-1MB באזור ה-Staging +MAX_SIZE=1048576 # 1MB בבייטים + +for file in $(git diff --cached --name-only); do + if [ -f "$file" ]; then + file_size=$(wc -c < "$file") + if [ "$file_size" -gt "$MAX_SIZE" ]; then + echo "❌ שגיאה: הקובץ '$file' גדול מ-1MB ($file_size בייטים)!" + echo "אנא הסר אותו או הקטן את גודלו לפני ביצוע קומיט." + exit 1 + fi + fi +done + +# חוק 2: חסימת מפתחות גישה (Secrets) של AWS +if git diff --cached | grep -qE 'AKIA[A-Z0-9]{16}|ASIA[A-Z0-9]{16}'; then + echo "❌ שגיאה: זוהה מפתח גישה חסוי (AWS Access Key) בשינויים שהכנת לקומיט!" + echo "אבטחה ראשונה! חסמנו את הקומיט כדי למנוע דליפת סודות." + exit 1 +fi + +exit 0 +EOF diff --git a/pull_request.md b/pull_request.md index 38541a0..94e0c3b 100644 --- a/pull_request.md +++ b/pull_request.md @@ -200,3 +200,4 @@ Anand Sreekumar- Udemy course Gurubalan - DevOps 1 Prince O Yeshwanth Madineni — Group +* daganm07 diff --git a/scripts/notify.sh b/scripts/notify.sh new file mode 100644 index 0000000..f39649c --- /dev/null +++ b/scripts/notify.sh @@ -0,0 +1,3 @@ +#!/bin/bash +# Fixed: removed hardcoded credentials pattern to satisfy git pre-commit hook safety net +echo "Notification script initialized successfully."