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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:
- uses: actions/checkout@v4
- name: Check for non-English strings
run: |
GERMAN=$(grep -rlE 'ä|ö|ü|ß' --include='*.sh' . || true)
GERMAN=$(grep -rlP '\xc3[\xa4\xb6\xbc\x9f]' --include='*.sh' --exclude-dir=tests . || true)
if [[ -n "$GERMAN" ]]; then
echo "Files with German characters:"
echo "$GERMAN"
grep -rnE 'ä|ö|ü|ß' --include='*.sh' .
grep -rnP '\xc3[\xa4\xb6\xbc\x9f]' --include='*.sh' --exclude-dir=tests .
exit 1
fi
echo "All clear — no German strings found."
3 changes: 2 additions & 1 deletion config.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Night Shift Configuration
# Night Shift Configuration. Sourced by coordinator.sh, worker.sh, etc.
# shellcheck disable=SC2034
# Edit this file to match your environment

# ─── Repositories to scan ───
Expand Down
9 changes: 6 additions & 3 deletions coordinator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ main() {
log "Ollama: $(curl -s -o /dev/null -w '%{http_code}' http://localhost:11434/api/tags 2>/dev/null || echo 'OFFLINE')"
log "--- Repo Status ---"
for rp in "${REPOS[@]}"; do
local rn=$(basename "$rp")
local rchanges=$(git -C "$rp" status --porcelain 2>/dev/null | wc -l)
local rbranch=$(git -C "$rp" branch --show-current 2>/dev/null)
local rn
rn=$(basename "$rp")
local rchanges
rchanges=$(git -C "$rp" status --porcelain 2>/dev/null | wc -l)
local rbranch
rbranch=$(git -C "$rp" branch --show-current 2>/dev/null)
log " $rn: Branch=$rbranch, Changes=$rchanges"
done
log "---"
Expand Down
4 changes: 2 additions & 2 deletions tests/test-nightshift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ if command -v shellcheck &>/dev/null; then
for script in config.sh coordinator.sh worker.sh summary.sh summary-morning.sh lesson-generator.sh install.sh; do
TESTS_RUN=$((TESTS_RUN + 1))
sc_output=$(shellcheck -S warning "$PROJECT_DIR/$script" 2>&1 || true)
sc_errors=$(echo "$sc_output" | grep -c "^In " || echo "0")
sc_errors=$(echo "$sc_output" | grep -c "^In " || true)
if [[ "$sc_errors" -eq 0 ]]; then
TESTS_PASSED=$((TESTS_PASSED + 1))
echo -e " ${GREEN}PASS${NC} shellcheck: $script"
Expand All @@ -313,7 +313,7 @@ echo "=== Language Check (English only) ==="
german_found=false
for script in config.sh coordinator.sh worker.sh summary.sh summary-morning.sh lesson-generator.sh install.sh; do
TESTS_RUN=$((TESTS_RUN + 1))
german_lines=$(grep -cE 'ä|ö|ü|ß' "$PROJECT_DIR/$script" 2>/dev/null | tr -d '[:space:]' || echo "0")
german_lines=$(grep -cP '\xc3[\xa4\xb6\xbc\x9f]' "$PROJECT_DIR/$script" 2>/dev/null | tr -d '[:space:]' || echo "0")
german_lines="${german_lines:-0}"
if [[ "$german_lines" -eq 0 ]]; then
TESTS_PASSED=$((TESTS_PASSED + 1))
Expand Down
8 changes: 5 additions & 3 deletions worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ main() {
exit 1
fi

IFS='|' read -r repo category title description risk_level llm_tier run_id <<< "$task_data"
IFS='|' read -r repo category title description _risk_level llm_tier _run_id <<< "$task_data"

# Resolve repo path — supports both basename and absolute path in REPOS
local repo_path=""
Expand All @@ -32,7 +32,8 @@ main() {
repo_path="$repo"
fi

local branch_name="nightshift/${category}-$(date +%Y%m%d)-$(echo "$title" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | head -c 40)"
local branch_name
branch_name="nightshift/${category}-$(date +%Y%m%d)-$(echo "$title" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | head -c 40)"

log "Worker started: [$category] $title (Repo: $repo)"
local safe_branch
Expand Down Expand Up @@ -73,7 +74,8 @@ main() {
if ! git rev-parse --verify "$base_branch" &>/dev/null; then
base_branch="main"
fi
local backup_tag="nightshift-backup/$(date +%Y%m%d-%H%M%S)-${repo}"
local backup_tag
backup_tag="nightshift-backup/$(date +%Y%m%d-%H%M%S)-${repo}"
git tag "$backup_tag" "$base_branch" 2>/dev/null || true

# Create branch
Expand Down
Loading