Skip to content

Commit cca5390

Browse files
committed
improvs
1 parent aa2f391 commit cca5390

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/CI_check_api_ref.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ jobs:
7575
- name: Generate API reference
7676
if: steps.config.outputs.changed == 'true' || steps.docstrings.outputs.changed == 'true'
7777
working-directory: integrations/${{ matrix.integration }}
78-
run: hatch run docs
78+
run: |
79+
hatch run docs
80+
# save the generated API reference content to a variable
81+
INTEGRATION_API_REFERENCE=$(cat integrations/${{ matrix.integration }}/${{ matrix.integration }}.md)
82+
echo "INTEGRATION_API_REFERENCE=$INTEGRATION_API_REFERENCE" >> "$GITHUB_OUTPUT"
7983
8084
- name: Checkout Haystack repo
8185
uses: actions/checkout@v6
@@ -86,12 +90,15 @@ jobs:
8690
- name: Sync API reference
8791
shell: python
8892
env:
89-
INTEGRATION_API_REFERENCE: integrations/${{ matrix.integration }}/${{ matrix.integration }}.md
93+
INTEGRATION_API_REFERENCE_FILENAME: ${{ matrix.integration }}.md
9094
run: |
9195
import os
9296
import shutil
9397
9498
integration_api_reference = os.environ['INTEGRATION_API_REFERENCE']
99+
integration_api_reference_filename = os.environ['INTEGRATION_API_REFERENCE_FILENAME']
100+
with open(integration_api_reference_filename, 'w') as f:
101+
f.write(integration_api_reference)
95102
96103
# Copy to main API reference
97104
shutil.copy(integration_api_reference, "docs-website/reference/integrations-api/")
@@ -103,7 +110,7 @@ jobs:
103110
integrations_api_ref_dir = os.path.join(version_dir.path, "integrations-api")
104111
shutil.copy(integration_api_reference, integrations_api_ref_dir)
105112
106-
# os.remove(artifact_filename)
113+
os.remove(integration_api_reference_filename)
107114
108115
- name: Print git status on docs
109116
working-directory: docs-website

0 commit comments

Comments
 (0)