From d8d9a27523bce6403fffcd53092c7b158d5afd0c Mon Sep 17 00:00:00 2001 From: Shivam Kumar Date: Wed, 10 Jun 2026 21:41:49 +0530 Subject: [PATCH] SCAL-317671 Removed the pipeline code of the sdk and added it in check pipeline run and version bump --- .github/workflows/auto-docgen.yml | 49 ------------------------------- .github/workflows/bumpVersion.yml | 5 +++- .github/workflows/main.yml | 28 ++++++++++++++++++ 3 files changed, 32 insertions(+), 50 deletions(-) delete mode 100644 .github/workflows/auto-docgen.yml diff --git a/.github/workflows/auto-docgen.yml b/.github/workflows/auto-docgen.yml deleted file mode 100644 index 389e4228e..000000000 --- a/.github/workflows/auto-docgen.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Auto Documentation Generation - -on: - schedule: - # '30 8' = 08:30 UTC | '*' = every day/month | '1' = Monday - - cron: '30 8 * * 1' - workflow_dispatch: # Allows you to trigger it manually via the Actions tab - -# Added permissions to allow the bot to push code -permissions: - contents: write - -jobs: - docgen: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '20.19.4' - registry-url: 'https://registry.npmjs.org' - - - name: Install dependencies - run: npm install --legacy-peer-deps - - - name: Generate documentation - run: npm run docgen - - - name: Commit and push documentation updates - run: | - git config user.name "${{ github.actor }}" - git config user.email "${{ github.actor }}@users.noreply.github.com" - - # Add only the specific file - git add static/typedoc/typedoc.json - - # Only commit if there are actually changes to that file - if git diff --staged --quiet; then - echo "No changes to documentation. Skipping push." - else - git commit -m "chore: auto-update generated documentation [skip ci]" - git push origin main - fi diff --git a/.github/workflows/bumpVersion.yml b/.github/workflows/bumpVersion.yml index 2994bec03..f5848abf7 100644 --- a/.github/workflows/bumpVersion.yml +++ b/.github/workflows/bumpVersion.yml @@ -53,12 +53,15 @@ jobs: - name: Install (lockfile refresh if needed) run: npm install --package-lock-only + - name: Generate documentation + run: npm run docgen + - name: Commit changes run: | BRANCH="${{ steps.bump.outputs.new_version }}" git checkout -b "$BRANCH" git status - git add package.json package-lock.json + git add package.json package-lock.json static/typedoc/typedoc.json git commit -m "chore: bump version to v${{ steps.bump.outputs.new_version }}" - name: Push branch diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7c9ed323b..7608252eb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,6 +21,8 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Use NodeJS v14.19.0 - uses: actions/setup-node@v2 @@ -31,6 +33,32 @@ jobs: - name: Run npm install run: npm install --legacy-peer-deps + # Check if generated documentation is up to date when version changes + - name: Verify generated documentation is committed + run: | + # Ensure we have the latest main branch reference locally to compare against + git fetch origin main:main + + # Check if package.json version changed compared to main branch + if git diff main package.json | grep -q '"version"'; then + echo "Package version was updated" + + # Regenerate documentation to verify it's current + npm run docgen + + # Check if there are any changes to typedoc.json after regeneration + if ! git diff --exit-code static/typedoc/typedoc.json > /dev/null; then + echo "::error::Generated documentation is out of date!" + echo "::error::The committed static/typedoc/typedoc.json does not match the generated output." + echo "::error::Please run 'npm run docgen' locally and commit the updated static/typedoc/typedoc.json file" + exit 1 + else + echo "✓ Documentation is up to date after regeneration" + fi + else + echo "Package version was not updated. Skipping doc check." + fi + # Verify lockfile is up to date - name: Verify package-lock.json is up to date run: |