mirror of
https://github.com/langgenius/dify-docs-archived.git
synced 2026-07-01 20:35:52 -04:00
73748657da
* Docs: update a macos command * Docs: update a macos command * Docs: update action file
44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
name: Language Check
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize]
|
|
paths:
|
|
- '**.md' # 只在 markdown 文件变更时触发
|
|
|
|
jobs:
|
|
lang-check:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0 # 获取完整的 git 历史,以便进行 diff 比较
|
|
|
|
- name: Setup Git
|
|
run: |
|
|
git config --global user.name "GitHub Action"
|
|
git config --global user.email "action@github.com"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y jq curl
|
|
|
|
- name: Run language check script
|
|
env:
|
|
DIFY_API_KEY: ${{ secrets.DIFY_API_KEY }}
|
|
run: |
|
|
chmod +x ./lang-check/git-diff.sh
|
|
output=$(./lang-check/git-diff.sh)
|
|
echo "$output" # 显示检查结果
|
|
|
|
# 检查输出中是否包含 ❌ 符号
|
|
if echo "$output" | grep -q "❌"; then
|
|
echo "检查发现问题,PR 不予通过"
|
|
exit 1 # 非零退出码会导致 Action 失败
|
|
else
|
|
echo "检查通过"
|
|
exit 0 # 零退出码表示 Action 成功
|
|
fi |