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
4a26d2ae
Commit
4a26d2ae
authored
Jan 21, 2024
by
chenhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update log messages
parent
6928d86f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
sync-howto-docs.yml
.github/workflows/sync-howto-docs.yml
+18
-5
No files found.
.github/workflows/sync-howto-docs.yml
View file @
4a26d2ae
...
...
@@ -19,10 +19,13 @@ jobs:
env
:
TARGET_REPO
:
'
https://github.com/langgenius/dify-docs.git'
TARGET_BRANCH
:
'
test-howto-sync'
ACCESS_TOKEN
:
${{ secrets.
REPO_ACCESS_TOKEN_GU
}}
ACCESS_TOKEN
:
${{ secrets.
DIFY_DOCS_ACCESS_TOKEN
}}
run
:
|
CHANGED_FILES=$(git diff --name-only --diff-filter=AMDR ${{ github.event.before }}..${{ github.event.after }} | grep -e 'howto-.*\.md$' || true)
echo "Changed files:"
echo "$CHANGED_FILES"
if [ -z "$CHANGED_FILES" ]; then
echo "No new how-to file changes to sync"
exit 0
...
...
@@ -31,10 +34,11 @@ jobs:
# sparse checkout dify-docs repo
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
git checkout $TARGET_BRANCH
echo "checked out target branch"
echo "Current branch: $TARGET_BRANCH"
git sparse-checkout set en/tutorials/ zh_CN/tutorials/
echo "set sparse checked out directories of dify-docs repo"
...
...
@@ -61,4 +65,13 @@ jobs:
git config user.email github-actions@github.com
git add .
git commit -m "Sync how-to markdown files from PR #${{ github.event.pull_request.number }} on main repo"
git push https://${ACCESS_TOKEN}@${TARGET_REPO#https://} HEAD:${TARGET_BRANCH}
\ No newline at end of file
echo "Pushing files to $TARGET_BRANCH branch of $TARGET_REPO"
if git push https://${ACCESS_TOKEN}@${TARGET_REPO#https://} HEAD:${TARGET_BRANCH}; then
echo "Files have been successfully pushed to $TARGET_BRANCH branch of $TARGET_REPO"
else
echo "Failed to push files to $TARGET_BRANCH branch of $TARGET_REPO"
exit 1
fi
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