-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.55 KB
/
dify_docs.yml
File metadata and controls
55 lines (47 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# This is a basic workflow that is manually triggered
name: Dify_Docs
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
push:
branches:
- main
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
run-custom-script:
name: Run pull change to dify api
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Gather changed files
id: gather_changes
run: |
PREV_SHA=$(git rev-parse HEAD^ || echo "")
echo "Previous SHA: $PREV_SHA"
if [ -z "$PREV_SHA" ]; then
CHANGED=$(git ls-files)
else
CHANGED=$(git diff --name-only --diff-filter=ACDMRTUXB $PREV_SHA HEAD)
fi
echo "Changed files:"
echo "$CHANGED"
echo "changed_files<<EOF" >> "$GITHUB_OUTPUT"
echo "$CHANGED" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
if [ -f .github/scripts/dify/requirements.txt ]; then
pip install -r .github/scripts/dify/requirements.txt
fi
- name: Run Python script
env:
CHANGED_FILES: ${{ steps.gather_changes.outputs.changed_files }}
run: |
python .github/scripts/dify/process_dify_api.py