Skip to content

Commit 3945d0b

Browse files
OhYeeCopilot
andauthored
Update .github/workflows/ci.yml
Co-authored-by: Copilot <[email protected]> Signed-off-by: OhYee <[email protected]>
1 parent 2a7b6d0 commit 3945d0b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,13 @@ jobs:
4343
id: changes
4444
run: |
4545
echo "Checking if agentrun directory has changes..."
46-
# 获取最近两次提交之间的差异
47-
git diff --name-only HEAD^ HEAD > changed_files.txt || echo "Cannot get diff, checking all files" > changed_files.txt
46+
# 获取最近两次提交之间的差异;如果没有父提交,则将所有跟踪文件视为已更改
47+
if git rev-parse HEAD^ >/dev/null 2>&1; then
48+
git diff --name-only HEAD^ HEAD > changed_files.txt
49+
else
50+
echo "No parent commit; treating all tracked files as changed."
51+
git ls-files > changed_files.txt
52+
fi
4853
echo "Changed files:"
4954
cat changed_files.txt || echo "No changed files detected"
5055

0 commit comments

Comments
 (0)