-
Notifications
You must be signed in to change notification settings - Fork 0
Develop #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #2
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| '@ciscode/api-kit': minor | ||
| --- | ||
|
|
||
| Initial release of @ciscode/api-kit v0.1.0 | ||
|
|
||
| - `createApiClient` factory with typed `get`, `post`, `put`, `patch`, `delete` methods | ||
| - Built-in auth token injection via `getToken` config | ||
| - Composable request, response, and error interceptors | ||
| - `ApiError` class normalizing all HTTP/network errors | ||
| - Configurable retry with exponential backoff |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * @CISCODE-MA/devops |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: npm | ||
| directory: '/' | ||
| schedule: | ||
| interval: monthly | ||
| open-pull-requests-limit: 1 | ||
| groups: | ||
| npm-dependencies: | ||
| patterns: | ||
| - '*' | ||
| assignees: | ||
| - CISCODE-MA/devops | ||
| labels: | ||
| - 'dependencies' | ||
| - 'npm' | ||
| commit-message: | ||
| prefix: 'chore(deps)' | ||
| include: 'scope' | ||
| rebase-strategy: auto |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: CI - PR Validation | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [develop] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| validate: | ||
| name: CI - PR Validation | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| cache: npm | ||
|
|
||
| - name: Install | ||
| run: npm ci | ||
|
|
||
| - name: Format (check) | ||
| run: npm run format | ||
|
|
||
| - name: Lint | ||
| run: npm run lint | ||
|
|
||
| - name: Typecheck | ||
| run: npm run typecheck | ||
|
|
||
| - name: Test | ||
| run: npm test | ||
|
|
||
| - name: Build | ||
| run: npm run build |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,16 +3,6 @@ name: CI - Release Check | |
| on: | ||
| pull_request: | ||
| branches: [master] | ||
| workflow_dispatch: | ||
| inputs: | ||
| sonar: | ||
| description: 'Run SonarCloud analysis' | ||
| required: true | ||
| default: 'false' | ||
| type: choice | ||
| options: | ||
| - 'false' | ||
| - 'true' | ||
|
|
||
| concurrency: | ||
| group: ci-release-${{ github.ref }} | ||
|
|
@@ -24,15 +14,11 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| timeout-minutes: 25 | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| # Update these values for your package: | ||
| # - SONAR_PROJECT_KEY: "CISCODE-MA_YourPackageName" | ||
| # Config stays in the workflow file (token stays in repo secrets) | ||
| env: | ||
| SONAR_HOST_URL: 'https://sonarcloud.io' | ||
| SONAR_ORGANIZATION: 'ciscode' | ||
| SONAR_PROJECT_KEY: 'CISCODE-MA_PACKAGE_NAME_TEMPLATE' | ||
| SONAR_PROJECT_KEY: 'CISCODE-MA_ApiKit' | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
|
|
@@ -43,14 +29,14 @@ jobs: | |
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: npm | ||
| node-version: '22' | ||
| cache: 'npm' | ||
|
|
||
| - name: Install | ||
| run: npm install | ||
| run: npm ci | ||
|
|
||
| - name: Audit | ||
| run: npm audit --prod | ||
| run: npm audit --omit=dev | ||
|
|
||
| - name: Format | ||
| run: npm run format | ||
|
|
@@ -68,20 +54,22 @@ jobs: | |
| run: npm run build | ||
|
|
||
| - name: SonarCloud Scan | ||
| if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.sonar == 'true' }} | ||
| if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | ||
| uses: SonarSource/sonarqube-scan-action@v6 | ||
| env: | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
| SONAR_HOST_URL: ${{ env.SONAR_HOST_URL }} | ||
|
Comment on lines
56
to
61
|
||
| with: | ||
| args: > | ||
| -Dsonar.organization=${{ env.SONAR_ORGANIZATION }} \ | ||
| -Dsonar.projectKey=${{ env.SONAR_PROJECT_KEY }} \ | ||
| -Dsonar.sources=src \ | ||
| -Dsonar.organization=${{ env.SONAR_ORGANIZATION }} | ||
| -Dsonar.projectKey=${{ env.SONAR_PROJECT_KEY }} | ||
| -Dsonar.sources=src | ||
| -Dsonar.tests=src | ||
| -Dsonar.test.inclusions=src/**/*.test.ts,src/**/*.test.tsx,src/**/*.spec.ts,src/__tests__/** | ||
| -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info | ||
|
|
||
| - name: SonarCloud Quality Gate | ||
| if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.sonar == 'true' }} | ||
| if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | ||
| uses: SonarSource/sonarqube-quality-gate-action@v1 | ||
| timeout-minutes: 10 | ||
| env: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The publish workflow now only checks that the computed version tag exists somewhere in the repo, not that it points to the commit being built. This can allow publishing from an untagged HEAD (or a HEAD whose package.json version matches an older tag). Validate that
TAGresolves toHEAD(or thatHEADis exactly tagged) before proceeding.