Skip to content

Commit

Permalink
workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanminutillo committed Jan 8, 2025
1 parent 5db4348 commit f1e75f4
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions .github/workflows/watch-repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,43 @@ jobs:
chmod +x api_helper.sh
- name: Full Repository Ingestion
if: >-
steps.config.outputs.config_exists == 'true' && github.event_name == 'workflow_dispatch' && github.event.inputs.full_ingest == 'true'
steps.config.outputs.config_exists == 'true' && github.event_name ==
'workflow_dispatch' && github.event.inputs.full_ingest == 'true'
run: |
source ./api_helper.sh
echo "Starting full repository ingestion..."
echo "DEBUG: Making initial API call..."
# Make the API call - response is already validated by call_api
# First construct the REQUEST_BODY using jq
REQUEST_BODY=$(jq -n \
--arg repo "${{ github.repository }}" \
--arg branch "${{ github.ref_name }}" \
--arg event_type "${{ github.event_name }}" \
--arg commit_sha "${{ github.sha }}" \
--argjson config "$CONFIG" \
'{
"repo": $repo,
"branch": $branch,
"metadata": {
"repository": $repo,
"branch": $branch,
"event_type": $event_type,
"commit_sha": $commit_sha,
"process_timestamp": (now | strftime("%Y-%m-%dT%H:%M:%SZ")),
"config": $config
},
"maxFileSize": ($config.max_file_size // 100000),
"maxTokens": ($config.max_tokens // 50000),
"forceReplace": true
}'
)
echo "DEBUG: Request body:"
echo "$REQUEST_BODY" | jq '.'
# Make the API call
echo "Making API call to ingest-repo..."
response=$(call_api "${{ steps.config.outputs.osiris_url }}/api/ingest-repo" "$REQUEST_BODY")
api_status=$?
Expand Down

0 comments on commit f1e75f4

Please sign in to comment.