GITBOOK-169: No subject #32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |