新增 GitHub Actions 配置模板

This commit is contained in:
严浩
2025-06-18 12:57:29 +08:00
parent 7b93178a71
commit 605638e1cc

View File

@ -3,6 +3,15 @@
# h-hosts.sh - 配置hosts文件脚本 # h-hosts.sh - 配置hosts文件脚本
# 用于添加指定域名解析记录到 /etc/hosts 文件 # 用于添加指定域名解析记录到 /etc/hosts 文件
# GitHub Actions 配置模板
GITHUB_ACTIONS_CONFIG='
steps:
- name: 配置 hosts
run: |
URL="https://Git.1-H.CC/Scripts/Linux/raw/branch/main/h-hosts.sh"; curl -fsSL "$URL" | bash
'
# 检查是否有root权限 # 检查是否有root权限
if [ "$EUID" -ne 0 ]; then if [ "$EUID" -ne 0 ]; then
echo "错误: 此脚本需要root权限运行" echo "错误: 此脚本需要root权限运行"