-
Notifications
You must be signed in to change notification settings - Fork 84
84 lines (73 loc) · 2.76 KB
/
api-validation.yml
File metadata and controls
84 lines (73 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: API Validation
on:
workflow_dispatch:
inputs:
validation_scope:
description: 'Which APIs to validate'
required: true
default: 'all-apis'
type: choice
options:
- 'all-apis'
- 'pinecone-only'
- 'github-only'
- 'gemini-only'
permissions:
issues: read
contents: read
jobs:
validate-apis:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: npm install
- name: Validate All APIs
if: github.event.inputs.validation_scope == 'all-apis'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
GITHUB_REPOSITORY: ${{ github.repository }}
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
PINECONE_INDEX: ${{ secrets.PINECONE_INDEX }}
run: |
echo "🔍 Validating all API connections..."
node .github/scripts/validate-apis.js
- name: Validate Pinecone Only
if: github.event.inputs.validation_scope == 'pinecone-only'
env:
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
PINECONE_INDEX: ${{ secrets.PINECONE_INDEX }}
run: |
echo "🔍 Validating Pinecone database connection..."
node .github/scripts/validate-apis.js pinecone
- name: Validate GitHub Only
if: github.event.inputs.validation_scope == 'github-only'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: |
echo "🔍 Validating GitHub API connection..."
node .github/scripts/validate-apis.js github
- name: Validate Gemini Only
if: github.event.inputs.validation_scope == 'gemini-only'
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: |
echo "🔍 Validating Gemini API connection..."
node .github/scripts/validate-apis.js gemini
- name: Validation Summary
if: always()
run: |
echo "### 🔍 API Validation Summary" >> $GITHUB_STEP_SUMMARY
echo "- **Validation Scope:** ${{ github.event.inputs.validation_scope }}" >> $GITHUB_STEP_SUMMARY
echo "- **Repository:** ${{ github.repository }}" >> $GITHUB_STEP_SUMMARY
echo "- **Triggered by:** @${{ github.actor }}" >> $GITHUB_STEP_SUMMARY
echo "- **Timestamp:** $(date -u)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "✅ Run this before database operations to ensure API connectivity." >> $GITHUB_STEP_SUMMARY