Skip to content

Commit

Permalink
Update sync_file.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
boy86001 authored Jan 2, 2025
1 parent 5b34a3b commit 6cd5b3f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/sync_file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ jobs:
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
# 确保分支存在(显式指定 main 分支)
# 确保主分支是 main,且本地分支与远程分支一致
DEFAULT_BRANCH="main"
git checkout $DEFAULT_BRANCH || git checkout -b $DEFAULT_BRANCH
git fetch origin $DEFAULT_BRANCH
git checkout $DEFAULT_BRANCH || git checkout -b $DEFAULT_BRANCH --track origin/$DEFAULT_BRANCH
# 添加文件并提交更改(如果有)
git add gfwlist.txt
Expand All @@ -32,4 +33,4 @@ jobs:
else
git commit -m "Auto-sync gfwlist.txt from upstream"
git push origin $DEFAULT_BRANCH
fi
fi

0 comments on commit 6cd5b3f

Please sign in to comment.