haystack/.github/workflows/sync_code_to_deepset.yml
mathislucka c54a68ab63
fix: files should not be passed as single string (#9559)
* fix: files should not be passed as single string

* chore: we want word splitting in this case

* fix: place directive before command

* fix: find correct directive placement
2025-06-27 11:17:42 +02:00

57 lines
1.7 KiB
YAML

name: Upload Code to Deepset
on:
push:
branches:
- main
jobs:
upload-files:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for proper diff
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install uv
run: |
pip install uv
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v46
with:
files: |
haystack/**/*.py
separator: ' '
- name: Upload files to Deepset
if: steps.changed-files.outputs.any_changed == 'true' || steps.changed-files.outputs.any_deleted == 'true'
env:
DEEPSET_API_KEY: ${{ secrets.DEEPSET_API_KEY }}
DEEPSET_WORKSPACE: haystack-code
run: |
# Combine added and modified files for upload
CHANGED_FILES=""
if [ -n "${{ steps.changed-files.outputs.added_files }}" ]; then
CHANGED_FILES="${{ steps.changed-files.outputs.added_files }}"
fi
if [ -n "${{ steps.changed-files.outputs.modified_files }}" ]; then
if [ -n "$CHANGED_FILES" ]; then
CHANGED_FILES="$CHANGED_FILES ${{ steps.changed-files.outputs.modified_files }}"
else
CHANGED_FILES="${{ steps.changed-files.outputs.modified_files }}"
fi
fi
# Run the script with changed and deleted files
# shellcheck disable=SC2086
uv run --no-project --no-config --no-cache .github/utils/deepset_sync.py \
--changed $CHANGED_FILES \
--deleted ${{ steps.changed-files.outputs.deleted_files }}