Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
6928d86f
Commit
6928d86f
authored
Jan 21, 2024
by
chenhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix sparse co
parent
d725a0be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
sync-howto-docs.yml
.github/workflows/sync-howto-docs.yml
+11
-2
No files found.
.github/workflows/sync-howto-docs.yml
View file @
6928d86f
...
@@ -21,7 +21,7 @@ jobs:
...
@@ -21,7 +21,7 @@ jobs:
TARGET_BRANCH
:
'
test-howto-sync'
TARGET_BRANCH
:
'
test-howto-sync'
ACCESS_TOKEN
:
${{ secrets.REPO_ACCESS_TOKEN_GU }}
ACCESS_TOKEN
:
${{ secrets.REPO_ACCESS_TOKEN_GU }}
run
:
|
run
:
|
CHANGED_FILES=$(git diff --name-only --diff-filter=AMDR ${{ github.event.before }} | grep -e 'howto-.*\.md$' || true)
CHANGED_FILES=$(git diff --name-only --diff-filter=AMDR ${{ github.event.before }}
..${{ github.event.after }}
| grep -e 'howto-.*\.md$' || true)
if [ -z "$CHANGED_FILES" ]; then
if [ -z "$CHANGED_FILES" ]; then
echo "No new how-to file changes to sync"
echo "No new how-to file changes to sync"
...
@@ -29,21 +29,30 @@ jobs:
...
@@ -29,21 +29,30 @@ jobs:
fi
fi
# sparse checkout dify-docs repo
# sparse checkout dify-docs repo
git clone --depth 1 --filter=blob:none --sparse $TARGET_REPO dify-docs-sparse
git clone --filter=blob:none --sparse $TARGET_REPO dify-docs-sparse
git checkout -b $TARGET_BRANCH
echo "checked out target branch"
cd dify-docs-sparse
cd dify-docs-sparse
git sparse-checkout set en/tutorials/ zh_CN/tutorials/
git sparse-checkout set en/tutorials/ zh_CN/tutorials/
echo "set sparse checked out directories of dify-docs repo"
# Sync files to different language directories
# Sync files to different language directories
for file in $CHANGED_FILES; do
for file in $CHANGED_FILES; do
echo "Processing file: $file"
if [[ $file == *"_CN.md" ]]; then
if [[ $file == *"_CN.md" ]]; then
TARGET_DIR="zh_CN/tutorials"
TARGET_DIR="zh_CN/tutorials"
else
else
TARGET_DIR="en/tutorials"
TARGET_DIR="en/tutorials"
fi
fi
echo "Target directory: $TARGET_DIR"
if [ -f "../$file" ]; then
if [ -f "../$file" ]; then
echo "Copying file to target directory"
cp "../$file" "$TARGET_DIR/"
cp "../$file" "$TARGET_DIR/"
else
else
echo "File not found, removing from target directory"
git rm "$TARGET_DIR/$(basename $file)" || true
git rm "$TARGET_DIR/$(basename $file)" || true
fi
fi
done
done
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment