fix(http): update Authorization header to use raw API key instead of … #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ v3, main ] | |
| pull_request: | |
| branches: [ v3, main ] | |
| jobs: | |
| test: | |
| name: Test (Node ${{ matrix.node-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18.x, 20.x, 22.x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Validate OpenAPI Specs | |
| run: npm run validate:spec | |
| - name: Generate Types from OpenAPI | |
| run: npm run generate | |
| - name: Run linter | |
| run: npm run lint | |
| - name: Run type checking | |
| run: npm run typecheck | |
| - name: Run tests | |
| run: npm test -- --run --reporter=verbose | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-node-${{ matrix.node-version }} | |
| path: | | |
| coverage/ | |
| test-results/ | |
| coverage: | |
| name: Coverage Report | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Validate and generate types | |
| run: | | |
| npm run validate:spec | |
| npm run generate | |
| - name: Generate coverage | |
| run: npm test -- --coverage --run | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage/coverage-final.json | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Validate OpenAPI Specs | |
| run: npm run validate:spec | |
| - name: Generate Types from OpenAPI | |
| run: npm run generate | |
| - name: Build package | |
| run: npm run build | |
| - name: Check build artifacts | |
| run: | | |
| test -f dist/index.cjs || (echo "CJS build missing" && exit 1) | |
| test -f dist/index.js || (echo "ESM build missing" && exit 1) | |
| test -f dist/index.d.ts || (echo "Types build missing" && exit 1) | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| openapi-validation: | |
| name: OpenAPI Validation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Validate all OpenAPI specs | |
| run: npm run validate:spec | |
| - name: Generate TypeScript types from all specs | |
| run: npm run generate | |
| - name: Verify generated types compile | |
| run: npm run typecheck | |
| - name: Upload generated types | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: openapi-generated-types | |
| path: src/generated/ | |
| - name: Comment on PR with spec info | |
| if: github.event_name == 'pull_request' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const specDir = 'openapi/spec'; | |
| const files = fs.readdirSync(specDir).filter(f => f.endsWith('.yaml')); | |
| const specsInfo = files.map(file => { | |
| const fullPath = path.join(specDir, file); | |
| const stats = fs.statSync(fullPath); | |
| const content = fs.readFileSync(fullPath, 'utf8'); | |
| const lines = content.split('\n').length; | |
| return `- \`${file}\` - ${(stats.size / 1024).toFixed(2)} KB, ${lines} lines`; | |
| }).join('\n'); | |
| const comment = `### 📋 OpenAPI Spec Validation | |
| ✅ All specs validated and types generated successfully | |
| **Specs processed:** | |
| ${specsInfo} | |
| Generated types available as artifact in \`src/generated/\`. | |
| `; | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: comment | |
| }); |