Compare commits

...
2 Commits
Author SHA1 Message Date
admin 0a23075bdd chore: 添加 .gitattributes 规范行尾 2026-08-26 21:13:18 +08:00
admin f729de4111 fix: 修复 KUBECONFIG_B64 解码校验 2026-08-26 21:13:18 +08:00
2 changed files with 9 additions and 1 deletions
+4
View File
@@ -0,0 +1,4 @@
# 行尾规范:文本文件统一 LF,Windows 批处理保留 CRLF
* text=auto eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
+5 -1
View File
@@ -34,12 +34,16 @@ jobs:
curl -sLO "https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl"
chmod +x kubectl
mv kubectl /usr/local/bin/
echo "${{ secrets.KUBECONFIG_B64 }}" | base64 -d > /tmp/kubeconfig
echo "${{ secrets.KUBECONFIG_B64 }}" | tr -d '[:space:]' | base64 -d > /tmp/kubeconfig
chmod 600 /tmp/kubeconfig
if [ ! -s /tmp/kubeconfig ]; then
echo "ERROR: KUBECONFIG_B64 secret 为空,请先在 lpt-infra 仓库配置 Secret"
exit 1
fi
if ! grep -q '^apiVersion:' /tmp/kubeconfig; then
echo "ERROR: KUBECONFIG_B64 解码后不是有效 kubeconfig,请重新生成并配置 Secret"
exit 1
fi
kubectl --kubeconfig=/tmp/kubeconfig config view --minify >/dev/null
- name: Apply manifests