♻️ refactor(runner): simplify shell helpers and workflow scripts
This commit is contained in:
@@ -133,12 +133,11 @@ echo "✓ Configuration file generated!"
|
||||
# 创建缓存目录
|
||||
mkdir -p cache
|
||||
|
||||
# 使用 Python 修改配置(最可靠的方法)
|
||||
# 使用 Python 修改配置
|
||||
echo ""
|
||||
echo "Configuring runner settings..."
|
||||
|
||||
if command -v python3 &> /dev/null; then
|
||||
python3 << PYEOF
|
||||
python3 << PYEOF
|
||||
import yaml
|
||||
import sys
|
||||
|
||||
@@ -184,32 +183,6 @@ except Exception as e:
|
||||
sys.exit(1)
|
||||
PYEOF
|
||||
|
||||
PYTHON_EXIT=$?
|
||||
|
||||
if [ $PYTHON_EXIT -ne 0 ]; then
|
||||
echo ""
|
||||
echo "⚠ Python configuration failed, using basic sed..."
|
||||
|
||||
# 基本的 sed 修改(只修改简单的值,不动 labels)
|
||||
sed -i 's/capacity: 1/capacity: 4/g' config.yaml || true
|
||||
sed -i 's/enabled: false/enabled: true/g' config.yaml || true
|
||||
sed -i 's|dir: ""|dir: ./cache|g' config.yaml || true
|
||||
|
||||
echo "✓ Basic configuration applied"
|
||||
echo " Note: Please manually verify labels in config.yaml match .runner"
|
||||
fi
|
||||
else
|
||||
echo "⚠ Python3 not found, applying basic configuration..."
|
||||
|
||||
# 基本的 sed 修改
|
||||
sed -i 's/capacity: 1/capacity: 4/g' config.yaml || true
|
||||
sed -i 's/enabled: false/enabled: true/g' config.yaml || true
|
||||
sed -i 's|dir: ""|dir: ./cache|g' config.yaml || true
|
||||
|
||||
echo "✓ Basic configuration applied"
|
||||
echo " Note: Labels will use act_runner defaults"
|
||||
fi
|
||||
|
||||
# 验证配置文件
|
||||
echo ""
|
||||
echo "Validating configuration..."
|
||||
|
||||
Reference in New Issue
Block a user