From 028ee574a5cb663c6111f871a8c430abf5923ac1 Mon Sep 17 00:00:00 2001 From: mafyuh Date: Sun, 9 Jun 2024 21:30:36 +0000 Subject: [PATCH] Update .forgejo/workflows/CD.yml --- .forgejo/workflows/CD.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/CD.yml b/.forgejo/workflows/CD.yml index 7304bbc..77d33ed 100644 --- a/.forgejo/workflows/CD.yml +++ b/.forgejo/workflows/CD.yml @@ -14,7 +14,11 @@ jobs: - name: Detect modified folders id: detect-changes run: | - folders=$(git diff-tree --no-commit-id --name-only -r HEAD^..HEAD | cut -d/ -f1 | sort | uniq) + if git rev-parse --verify HEAD^ >/dev/null 2>&1; then + folders=$(git diff-tree --no-commit-id --name-only -r HEAD^..HEAD | cut -d/ -f1 | sort | uniq) + else + folders=$(git diff-tree --no-commit-id --name-only -r origin/main..HEAD | cut -d/ -f1 | sort | uniq) + fi echo "Modified folders: $folders" echo "::set-output name=folders::$folders"