Skip to content

Commit 1cbef8e

Browse files
committed
工作流
1 parent f24e877 commit 1cbef8e

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

.github/workflows/sync-to-theme-repo.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,34 @@ jobs:
7272
"https://api.github.com/repos/fishcpy/astro-theme-fishcpy" | grep -q '"name"'; then
7373
echo "✅ Target repository exists"
7474
else
75-
echo "❌ Target repository does not exist!"
76-
echo "Please create the repository: https://github.com/fishcpy/astro-theme-fishcpy"
77-
echo "Or check if the repository name is correct"
78-
exit 1
75+
echo "❌ Target repository does not exist, creating it..."
76+
77+
# 创建仓库
78+
CREATE_RESPONSE=$(curl -s -X POST \
79+
-H "Authorization: token $PAT_TOKEN" \
80+
-H "Accept: application/vnd.github.v3+json" \
81+
https://api.github.com/user/repos \
82+
-d '{
83+
"name": "astro-theme-fishcpy",
84+
"description": "A beautiful Astro theme - fishcpy edition",
85+
"private": true,
86+
"auto_init": false
87+
}')
88+
89+
# 检查创建结果
90+
if echo "$CREATE_RESPONSE" | grep -q '"name"'; then
91+
echo "✅ Repository created successfully!"
92+
else
93+
echo "❌ Failed to create repository"
94+
echo "Response: $CREATE_RESPONSE"
95+
echo ""
96+
echo "Please manually create the repository:"
97+
echo "1. Go to https://github.com/new"
98+
echo "2. Repository name: astro-theme-fishcpy"
99+
echo "3. Make it private"
100+
echo "4. Don't initialize with README"
101+
exit 1
102+
fi
79103
fi
80104
81105
# 添加远程仓库

0 commit comments

Comments
 (0)