更新 .gitea/workflows/sync_raw_file.yml
Some checks failed
SyncRawFile / sync_files (push) Failing after 5s
Some checks failed
SyncRawFile / sync_files (push) Failing after 5s
This commit is contained in:
@@ -17,9 +17,9 @@ jobs:
|
||||
run: |
|
||||
# 定义文件目录和平台类型列表
|
||||
directories=("Lan" "Apple" "Steam" "SteamCN" "Xbox" "OpenAI" "Gemini" "Claude" "China" "Proxy")
|
||||
platform_types=("Surge" "Clash" "Loon" "QuantumultX" "Shadowrocket" )
|
||||
platform_types=("Surge" "Clash" "Loon" "QuantumultX" "Shadowrocket")
|
||||
|
||||
# 平台类型和文件扩展名的映射(Surge -> list, Clash -> txt)
|
||||
# 平台类型和文件扩展名的映射(Surge -> list, Clash -> list, 等)
|
||||
declare -A type_mapping
|
||||
type_mapping=(["Surge"]="list" ["Clash"]="list" ["Loon"]="list" ["QuantumultX"]="list" ["Shadowrocket"]="list")
|
||||
|
||||
@@ -27,20 +27,22 @@ jobs:
|
||||
for i in ${!directories[@]}; do
|
||||
directory=${directories[$i]}
|
||||
platform_type=${platform_types[$i]} # 使用平台类型变量
|
||||
filetype=${type_mapping[$platform_type]} # 获取文件类型(list 或 txt)
|
||||
filetype=${type_mapping[$platform_type]} # 获取文件类型(list)
|
||||
|
||||
# 构建文件 URL
|
||||
url="https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/${platform_type}/${directory}/${directory}.${filetype}"
|
||||
|
||||
# 动态生成保存目录路径,基于平台类型和文件目录
|
||||
save_dir="./${platform_type}/${directory}"
|
||||
|
||||
# 创建目录(如果不存在的话)
|
||||
mkdir -p $save_dir
|
||||
mkdir -p "$save_dir"
|
||||
|
||||
# 输出下载信息
|
||||
echo "Downloading $url to $save_dir/${directory}.${filetype}"
|
||||
|
||||
# 使用 curl 下载文件并保存到动态路径
|
||||
curl -o $save_dir/${directory}.${filetype} $url
|
||||
curl -o "$save_dir/${directory}.${filetype}" "$url"
|
||||
done
|
||||
|
||||
- name: Commit and push changes to Gitea
|
||||
|
||||
Reference in New Issue
Block a user