name: "GitRag Indexer" description: "Run the GitRag indexing CLI for libSQL or PostgreSQL" inputs: repo: description: "Repository identifier (namespace/name)" required: true full_index: description: "Set to true to index all tracked files" required: false default: "false" branch: description: "Branch name" required: false outputs: exit_code: description: "The numeric exit code of the indexer script" value: ${{ steps.run-indexer.outputs.exit_code }} runs: using: "composite" steps: - uses: astral-sh/setup-uv@v5 with: enable-cache: true python-version: "3.12" - uses: actions/cache@v4 with: path: ~/.cache/huggingface/hub key: hf-qwen3-embedding-reranker-v1 - name: Install dependencies shell: bash working-directory: ${{ github.action_path }} run: uv sync --all-packages -q - name: Index Repo id: run-indexer shell: bash env: PYTHONPATH: ${{ github.action_path }}/packages/core/src HF_HOME: ~/.cache/huggingface run: | set +e ARGS="" [ "${{ inputs.full_index }}" = "true" ] && ARGS="--full" [ -n "${{ inputs.branch }}" ] && ARGS="$ARGS --branch ${{ inputs.branch }}" # If not a full scan, pass the commit range if [ "${{ inputs.full_index }}" != "true" ]; then BEFORE="${{ github.event.before }}" if [ -n "$BEFORE" ] && [ "$BEFORE" != "0000000000000000000000000000000000000000" ]; then ARGS="$ARGS --from-sha $BEFORE --to-sha ${{ github.sha }}" fi fi ${{ github.action_path }}/.venv/bin/python ${{ github.action_path }}/packages/core/src/Indexer.py "${{ inputs.repo }}" $ARGS EXIT_CODE=$? echo "exit_code=$EXIT_CODE" >> "$GITHUB_OUTPUT" set -e # Explicitly fail the composite step if the Python script failed exit $EXIT_CODE