From de796645e8c5c6fbd00189def865dc5f54f82414 Mon Sep 17 00:00:00 2001 From: monthop-gmail Date: Thu, 27 Aug 2026 00:11:18 +0700 Subject: [PATCH 1/2] =?UTF-8?q?ci:=20=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87?= =?UTF-8?q?=E0=B8=A3=E0=B8=B1=E0=B8=99=20CI=20=E0=B9=80=E0=B8=AD=E0=B8=87?= =?UTF-8?q?=E0=B9=84=E0=B8=94=E0=B9=89=E0=B8=88=E0=B8=B2=E0=B8=81=E0=B8=AB?= =?UTF-8?q?=E0=B8=99=E0=B9=89=E0=B8=B2=20Actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit เพิ่ม workflow_dispatch เพื่อให้ re-run ตรวจ template ได้โดยไม่ต้อง push อะไรก่อน — มีประโยชน์ตอนอยากยืนยันว่า main ยังเขียวอยู่ Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Dru5ECsrJrqhTfUhUvDsqw --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da74734..a9ae93c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,8 @@ on: pull_request: push: branches: [main] + # สั่งรันเองได้จากหน้า Actions เวลาอยากเช็คซ้ำโดยไม่ต้อง push อะไร + workflow_dispatch: permissions: contents: read From 9bb565c0b8073dbf22331c7c2120f4cf8ece9721 Mon Sep 17 00:00:00 2001 From: monthop-gmail Date: Thu, 27 Aug 2026 00:13:45 +0700 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E0=B9=81=E0=B8=81=E0=B9=89=20SC2164?= =?UTF-8?q?=20=E0=B9=81=E0=B8=A5=E0=B8=B0=E0=B9=84=E0=B8=A1=E0=B9=88?= =?UTF-8?q?=E0=B9=83=E0=B8=AB=E0=B9=89=E0=B8=82=E0=B9=89=E0=B8=B2=E0=B8=A1?= =?UTF-8?q?=20shellcheck=20=E0=B9=80=E0=B8=87=E0=B8=B5=E0=B8=A2=E0=B8=9A?= =?UTF-8?q?=20=E0=B9=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI รอบแรกจับได้ว่า validate.sh บรรทัด 14 ทำ cd โดยไม่มี || exit ถ้า cd พลาดสคริปต์จะไปตรวจผิดโฟลเดอร์แล้วรายงานว่าผ่าน และช่องที่ทำให้พลาดตั้งแต่แรก: เครื่อง dev ที่ไม่มี shellcheck จะข้าม การตรวจไปเงียบ ๆ แล้วไปแดงเอาบน CI — ตอนนี้ถ้าอยู่ใน CI แล้วไม่เจอ shellcheck จะ fail ทันที ส่วนบนเครื่องจะเตือนชัดว่า CI ยังรันให้อยู่ Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Dru5ECsrJrqhTfUhUvDsqw --- scripts/validate.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/validate.sh b/scripts/validate.sh index e108e3c..1326121 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -11,7 +11,7 @@ set -uo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -cd "$(dirname "$SCRIPT_DIR")" +cd "$(dirname "$SCRIPT_DIR")" || exit 1 if [ -t 1 ]; then GREEN=$'\033[32m'; RED=$'\033[31m'; DIM=$'\033[2m'; RESET=$'\033[0m' @@ -135,8 +135,12 @@ check_shell() { for f in scripts/*.sh; do if shellcheck -S warning -f gcc "$f"; then ok "$f"; else fail=1; fi done + elif [ -n "${GITHUB_ACTIONS:-}" ]; then + # ใน CI ต้องมีเสมอ — ถ้าหายไปแปลว่า runner เปลี่ยน อย่าปล่อยผ่านเงียบ ๆ + err "scripts/" "ไม่พบ shellcheck บน runner" else - echo " ${DIM}(ไม่มี shellcheck บนเครื่องนี้ — ข้าม ติดตั้ง: apt install shellcheck)${RESET}" + printf ' %s(ไม่มี shellcheck บนเครื่องนี้ — ข้ามไปก่อน แต่ CI จะรันให้ ถ้าไม่อยากให้ PR แดง\n' "$DIM" + printf ' ติดตั้งด้วย: sudo apt install shellcheck)%s\n' "$RESET" fi head_ "scripts: ต้องรันได้ (mode 100755)"