{"record":{"id":"6e122db04e6f9c56","repo":"sickn33/agentic-awesome-skills","slug":"warn-s","errorCode":null,"errorMessage":"WARN %s","messagePattern":"WARN %s","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"skills/openclaw-github-repo-commander/scripts/repo-audit.sh","lineNumber":20,"sourceCode":"set -euo pipefail\n\ntarget=\"${1:-.}\"\n\nif [[ ! -d \"$target\" ]]; then\n  printf 'FAIL target directory does not exist: %s\\n' \"$target\" >&2\n  exit 2\nfi\n\ncd \"$target\"\nrepo_root=\"$(pwd -P)\"\n\nstatus=0\n\npass() {\n  printf 'PASS %s\\n' \"$1\"\n}\n\nwarn() {\n  printf 'WARN %s\\n' \"$1\"\n  status=1\n}\n\nhas_symlink_component() {\n  local candidate=\"$1\"\n  local current=\".\"\n  local part\n  local -a parts\n\n  candidate=\"${candidate#./}\"\n  IFS='/' read -r -a parts <<< \"$candidate\"\n  for part in \"${parts[@]}\"; do\n    [[ -z \"$part\" || \"$part\" == \".\" ]] && continue\n    current=\"$current/$part\"\n    if [[ -L \"$current\" ]]; then\n      return 0\n    fi","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/sickn33/agentic-awesome-skills/blob/58d857988fcfac6986206bca2b2fe223aa437e4b/skills/openclaw-github-repo-commander/scripts/repo-audit.sh#L2-L38","documentation":"This is the warn() helper in scripts/repo-audit.sh. It prints 'WARN <finding>' and sets status=1, so any audit finding (hardcoded-secret pattern, node_modules present, ripgrep missing, symlinked path component, etc.) marks the audit as failed without aborting the script; the final exit code reflects status. It is a non-fatal audit finding, not a crash.","triggerScenarios":"Running ./scripts/repo-audit.sh <target> where the target contains a string matching ghp_..., sk-..., or AKIA... in the secret scan, has a node_modules directory, lacks ripgrep so the scan is skipped, or triggers any other check that calls warn. Each warn prints 'WARN <message>' and forces exit status 1.","commonSituations":"CI audit gates failing with exit 1; a committed .env, fixture, or docs snippet containing a realistic-looking key; a locally generated node_modules that was never gitignored; a CI image without ripgrep installed so the secret scan warns 'skipped'.","solutions":["Re-run the audit and read the specific WARN line(s) printed — each names the exact finding and file condition.","If the finding is 'possible hardcoded secret pattern found', locate the match (rg 'ghp_|sk-|AKIA'), remove the credential, and rotate it if it was ever real.","If it is 'node_modules directory present', add node_modules/ to .gitignore and run git rm -r --cached node_modules.","If it is 'ripgrep not installed', install rg (apt/brew/pacman) so the secret scan actually runs.","Treat exit 1 as actionable: fix every WARN until all lines are PASS."],"exampleFix":"# before: realistic key committed in scripts/deploy.sh\nexport OPENAI_API_KEY=sk-abcdefghij1234567890abcdefghij\n\n# after: read from environment; rotate the leaked key\nexport OPENAI_API_KEY=\"$OPENAI_API_KEY\"","handlingStrategy":"validation","validationCode":"# Pre-check the highest-signal findings before running the full audit\nrg --hidden --glob '!.git/**' 'ghp_[A-Za-z0-9_]{20,}|sk-[A-Za-z0-9]{20,}|AKIA[0-9A-Z]{16}' . && { echo 'secret pattern present'; exit 1; }\ngit ls-files | grep -qE 'node_modules/' && { echo 'node_modules committed'; exit 1; }\ncommand -v rg >/dev/null || { echo 'install ripgrep'; exit 1; }","typeGuard":"# Bash predicate mirroring the audit's secret check\nhas_secret_pattern() {\n  rg --quiet 'ghp_[A-Za-z0-9_]{20,}|sk-[A-Za-z0-9]{20,}|AKIA[0-9A-Z]{16}' \"$1\"\n}","tryCatchPattern":null,"preventionTips":["Run ./scripts/repo-audit.sh as a pre-commit hook or CI job so findings surface before merge.","Keep real credentials in env vars or a secret manager and use obviously fake placeholders in fixtures so the secret scan never matches.","Install ripgrep in the dev/CI image so the secret scan runs instead of warning 'skipped'.","Treat exit 1 as actionable: read each WARN line and fix the named finding before re-running."],"tags":["bash","audit","secrets","ci","repo-hygiene"],"backgroundTag":"audit-script-warning-finding","analyzedSha":"58d857988fcfac6986206bca2b2fe223aa437e4b","analyzedAt":"2026-08-26T11:55:59.350Z","schemaVersion":2},"datasetVersion":"2026-08-26T14:46:13.012Z"}