From 76f8784ba63037707ce303ff679c6295f914a70c Mon Sep 17 00:00:00 2001 From: Aravind Putrevu Date: Mon, 14 Apr 2025 21:48:50 +0200 Subject: [PATCH 1/7] Update GitHub Actions workflow to use INKEEP_API_KEY environment variable consistently --- .github/workflows/node.js.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yaml b/.github/workflows/node.js.yaml index 22575dd0..9d23b0ab 100644 --- a/.github/workflows/node.js.yaml +++ b/.github/workflows/node.js.yaml @@ -14,6 +14,8 @@ on: jobs: test: runs-on: ubuntu-latest + env: + INKEEP_API_KEY: ${{ secrets.INKEEP_API_KEY }} steps: - uses: actions/checkout@v4 @@ -27,7 +29,7 @@ jobs: - run: pnpm install --frozen-lockfile --strict-peer-dependencies - run: pnpm run build env: - API_KEY: ${{ secrets.INKEEP_API_KEY }} + INKEEP_API_KEY: ${{ secrets.INKEEP_API_KEY }} - run: pnpm run lint fix: From c2cb5c4854ec8050e12527ef588fb8d554cbab83 Mon Sep 17 00:00:00 2001 From: sarah_inkeep Date: Mon, 14 Apr 2025 14:21:28 -0700 Subject: [PATCH 2/7] test setting env var --- .github/workflows/build.yaml | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..2172fb88 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,38 @@ +name: Build and Test Docusaurus + +on: + push: + branches: [debug-env] # adjust as needed + +jobs: + build: + runs-on: ubuntu-latest + env: + INKEEP_API_KEY: ${{ secrets.INKEEP_API_KEY }} + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: "16" # or your preferred version + + - name: Install dependencies + run: npm install + + # Debug step to verify the environment variable is set. + - name: Verify INKEEP_API_KEY is set + run: | + echo "Verifying environment variable..." + if [ -z "$INKEEP_API_KEY" ]; then + echo "Error: INKEEP_API_KEY is NOT set" + exit 1 + else + echo "Success: INKEEP_API_KEY is set" + # Optional: Print out the length of the key instead of the key itself. + echo "The key has ${#INKEEP_API_KEY} characters." + fi + + - name: Build Docusaurus site + run: npm run build From 1f4aa7db3e685085140622315de78420042b3790 Mon Sep 17 00:00:00 2001 From: sarah_inkeep Date: Mon, 14 Apr 2025 14:34:40 -0700 Subject: [PATCH 3/7] Fix node version --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2172fb88..59a42865 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,7 +16,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: "16" # or your preferred version + node-version: 22 # or your preferred version - name: Install dependencies run: npm install From ce8a19a32fb9eb1f3f87c7000bf8d427344381ce Mon Sep 17 00:00:00 2001 From: sarah_inkeep Date: Mon, 14 Apr 2025 14:35:09 -0700 Subject: [PATCH 4/7] Comment out workflows --- .github/workflows/algolia.yaml | 44 ++++----- .github/workflows/node.js.yaml | 160 ++++++++++++++++----------------- 2 files changed, 102 insertions(+), 102 deletions(-) diff --git a/.github/workflows/algolia.yaml b/.github/workflows/algolia.yaml index 9e18d8aa..0bcba9a0 100644 --- a/.github/workflows/algolia.yaml +++ b/.github/workflows/algolia.yaml @@ -1,25 +1,25 @@ # generate a workflow that triggers in push to main -name: Algolia Re-crawler +# name: Algolia Re-crawler -on: - push: - branches: - - main - workflow_dispatch: +# on: +# push: +# branches: +# - main +# workflow_dispatch: -jobs: - algolia_recrawl: - runs-on: ubuntu-latest - steps: - - name: Sleep for 120s - run: sleep 120 - - name: Algolia crawler creation and crawl - uses: algolia/algoliasearch-crawler-github-actions@v1.0.10 - id: algolia_crawler - with: # mandatory parameters - crawler-user-id: ${{ secrets.CRAWLER_USER_ID }} - crawler-api-key: ${{ secrets.CRAWLER_API_KEY }} - algolia-app-id: ${{ secrets.ALGOLIA_APP_ID }} - algolia-api-key: ${{ secrets.ALGOLIA_API_KEY }} - crawler-name: coderabbit - site-url: "https://docs.coderabbit.ai" +# jobs: +# algolia_recrawl: +# runs-on: ubuntu-latest +# steps: +# - name: Sleep for 120s +# run: sleep 120 +# - name: Algolia crawler creation and crawl +# uses: algolia/algoliasearch-crawler-github-actions@v1.0.10 +# id: algolia_crawler +# with: # mandatory parameters +# crawler-user-id: ${{ secrets.CRAWLER_USER_ID }} +# crawler-api-key: ${{ secrets.CRAWLER_API_KEY }} +# algolia-app-id: ${{ secrets.ALGOLIA_APP_ID }} +# algolia-api-key: ${{ secrets.ALGOLIA_API_KEY }} +# crawler-name: coderabbit +# site-url: "https://docs.coderabbit.ai" diff --git a/.github/workflows/node.js.yaml b/.github/workflows/node.js.yaml index 9d23b0ab..0c2f3d59 100644 --- a/.github/workflows/node.js.yaml +++ b/.github/workflows/node.js.yaml @@ -1,95 +1,95 @@ -name: Node.js CI +# name: Node.js CI -on: - merge_group: - branches: - - main - pull_request: - branches: - - main - push: - branches: - - main +# on: +# merge_group: +# branches: +# - main +# pull_request: +# branches: +# - main +# push: +# branches: +# - main -jobs: - test: - runs-on: ubuntu-latest - env: - INKEEP_API_KEY: ${{ secrets.INKEEP_API_KEY }} +# jobs: +# test: +# runs-on: ubuntu-latest +# env: +# INKEEP_API_KEY: ${{ secrets.INKEEP_API_KEY }} - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: latest - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: pnpm - - run: pnpm install --frozen-lockfile --strict-peer-dependencies - - run: pnpm run build - env: - INKEEP_API_KEY: ${{ secrets.INKEEP_API_KEY }} - - run: pnpm run lint +# steps: +# - uses: actions/checkout@v4 +# - uses: pnpm/action-setup@v4 +# with: +# version: latest +# - uses: actions/setup-node@v4 +# with: +# node-version: 22 +# cache: pnpm +# - run: pnpm install --frozen-lockfile --strict-peer-dependencies +# - run: pnpm run build +# env: +# INKEEP_API_KEY: ${{ secrets.INKEEP_API_KEY }} +# - run: pnpm run lint - fix: - runs-on: ubuntu-latest +# fix: +# runs-on: ubuntu-latest - permissions: - contents: write +# permissions: +# contents: write - needs: - - test +# needs: +# - test - if: failure() && github.event_name != 'merge_group' && github.actor != 'github-actions[bot]' && github.actor != 'nektos/act' +# if: failure() && github.event_name != 'merge_group' && github.actor != 'github-actions[bot]' && github.actor != 'nektos/act' - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.ref }} - - uses: pnpm/action-setup@v4 - with: - version: latest - - uses: actions/setup-node@v4 - with: - cache: pnpm - node-version: 22 +# steps: +# - uses: actions/checkout@v4 +# with: +# ref: ${{ github.ref }} +# - uses: pnpm/action-setup@v4 +# with: +# version: latest +# - uses: actions/setup-node@v4 +# with: +# cache: pnpm +# node-version: 22 - - run: | - pnpm install --fix-lockfile --no-frozen-lockfile - git add . - - id: commit-lockfile - uses: qoomon/actions--create-commit@v1 - with: - message: | - 📌 pnpm install --fix-lockfile +# - run: | +# pnpm install --fix-lockfile --no-frozen-lockfile +# git add . +# - id: commit-lockfile +# uses: qoomon/actions--create-commit@v1 +# with: +# message: | +# 📌 pnpm install --fix-lockfile - [dependabot skip] - skip-empty: true +# [dependabot skip] +# skip-empty: true - - run: | - pnpm run format - git add . - - id: commit-format - uses: qoomon/actions--create-commit@v1 - with: - message: | - 🎨 pnpm run format +# - run: | +# pnpm run format +# git add . +# - id: commit-format +# uses: qoomon/actions--create-commit@v1 +# with: +# message: | +# 🎨 pnpm run format - [dependabot skip] - skip-empty: true +# [dependabot skip] +# skip-empty: true - - run: | - pnpm run lint:fix - git add . - - id: commit-lint - uses: qoomon/actions--create-commit@v1 - with: - message: | - 🚨 pnpm run lint:fix +# - run: | +# pnpm run lint:fix +# git add . +# - id: commit-lint +# uses: qoomon/actions--create-commit@v1 +# with: +# message: | +# 🚨 pnpm run lint:fix - [dependabot skip] - skip-empty: true +# [dependabot skip] +# skip-empty: true - - if: steps.commit-lockfile.outputs.commit || steps.commit-format.outputs.commit || steps.commit-lint.outputs.commit - run: git push +# - if: steps.commit-lockfile.outputs.commit || steps.commit-format.outputs.commit || steps.commit-lint.outputs.commit +# run: git push From be8b66eac0d0e3dcc37ea40f2ea011f20b9de0f5 Mon Sep 17 00:00:00 2001 From: sarah_inkeep Date: Mon, 14 Apr 2025 14:49:26 -0700 Subject: [PATCH 5/7] Add consolelog --- docusaurus.config.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index f4cd07ca..de352b5c 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -15,11 +15,13 @@ */ import { themes as prismThemes } from "prism-react-renderer" -import { EnumChangefreq } from "sitemap" +import type { EnumChangefreq } from "sitemap" import type * as Preset from "@docusaurus/preset-classic" import type { Config } from "@docusaurus/types" +console.log("THE API KEY LENGTH IS:", process.env.INKEEP_API_KEY?.length) + const baseUrl = "/" const config: Config = { From 71ec33b27c264606cf489271f12cb8b931043e75 Mon Sep 17 00:00:00 2001 From: sarah_inkeep Date: Mon, 14 Apr 2025 15:06:07 -0700 Subject: [PATCH 6/7] More debugging --- .github/workflows/node.js.yaml | 163 +++++++++++++++++---------------- docusaurus.config.ts | 5 +- 2 files changed, 87 insertions(+), 81 deletions(-) diff --git a/.github/workflows/node.js.yaml b/.github/workflows/node.js.yaml index 0c2f3d59..c68cb1ee 100644 --- a/.github/workflows/node.js.yaml +++ b/.github/workflows/node.js.yaml @@ -1,95 +1,98 @@ -# name: Node.js CI +name: Node.js CI -# on: -# merge_group: -# branches: -# - main -# pull_request: -# branches: -# - main -# push: -# branches: -# - main +on: + merge_group: + branches: + - main + pull_request: + branches: + - main + push: + branches: + - main -# jobs: -# test: -# runs-on: ubuntu-latest -# env: -# INKEEP_API_KEY: ${{ secrets.INKEEP_API_KEY }} +jobs: + test: + runs-on: ubuntu-latest + env: + INKEEP_API_KEY: ${{ secrets.INKEEP_API_KEY }} -# steps: -# - uses: actions/checkout@v4 -# - uses: pnpm/action-setup@v4 -# with: -# version: latest -# - uses: actions/setup-node@v4 -# with: -# node-version: 22 -# cache: pnpm -# - run: pnpm install --frozen-lockfile --strict-peer-dependencies -# - run: pnpm run build -# env: -# INKEEP_API_KEY: ${{ secrets.INKEEP_API_KEY }} -# - run: pnpm run lint + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + with: + version: latest + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + - run: pnpm install --frozen-lockfile --strict-peer-dependencies + - name: Print INKEEP_API_KEY length + run: | + echo "INKEEP_API_KEY Length: ${#INKEEP_API_KEY}" + - run: pnpm run build + env: + INKEEP_API_KEY: ${{ secrets.INKEEP_API_KEY }} + - run: pnpm run lint -# fix: -# runs-on: ubuntu-latest + fix: + runs-on: ubuntu-latest -# permissions: -# contents: write + permissions: + contents: write -# needs: -# - test + needs: + - test -# if: failure() && github.event_name != 'merge_group' && github.actor != 'github-actions[bot]' && github.actor != 'nektos/act' + if: failure() && github.event_name != 'merge_group' && github.actor != 'github-actions[bot]' && github.actor != 'nektos/act' -# steps: -# - uses: actions/checkout@v4 -# with: -# ref: ${{ github.ref }} -# - uses: pnpm/action-setup@v4 -# with: -# version: latest -# - uses: actions/setup-node@v4 -# with: -# cache: pnpm -# node-version: 22 + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + - uses: pnpm/action-setup@v4 + with: + version: latest + - uses: actions/setup-node@v4 + with: + cache: pnpm + node-version: 22 -# - run: | -# pnpm install --fix-lockfile --no-frozen-lockfile -# git add . -# - id: commit-lockfile -# uses: qoomon/actions--create-commit@v1 -# with: -# message: | -# 📌 pnpm install --fix-lockfile + - run: | + pnpm install --fix-lockfile --no-frozen-lockfile + git add . + - id: commit-lockfile + uses: qoomon/actions--create-commit@v1 + with: + message: | + 📌 pnpm install --fix-lockfile -# [dependabot skip] -# skip-empty: true + [dependabot skip] + skip-empty: true -# - run: | -# pnpm run format -# git add . -# - id: commit-format -# uses: qoomon/actions--create-commit@v1 -# with: -# message: | -# 🎨 pnpm run format + - run: | + pnpm run format + git add . + - id: commit-format + uses: qoomon/actions--create-commit@v1 + with: + message: | + 🎨 pnpm run format -# [dependabot skip] -# skip-empty: true + [dependabot skip] + skip-empty: true -# - run: | -# pnpm run lint:fix -# git add . -# - id: commit-lint -# uses: qoomon/actions--create-commit@v1 -# with: -# message: | -# 🚨 pnpm run lint:fix + - run: | + pnpm run lint:fix + git add . + - id: commit-lint + uses: qoomon/actions--create-commit@v1 + with: + message: | + 🚨 pnpm run lint:fix -# [dependabot skip] -# skip-empty: true + [dependabot skip] + skip-empty: true -# - if: steps.commit-lockfile.outputs.commit || steps.commit-format.outputs.commit || steps.commit-lint.outputs.commit -# run: git push + - if: steps.commit-lockfile.outputs.commit || steps.commit-format.outputs.commit || steps.commit-lint.outputs.commit + run: git push diff --git a/docusaurus.config.ts b/docusaurus.config.ts index de352b5c..beb8f143 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -20,7 +20,10 @@ import type { EnumChangefreq } from "sitemap" import type * as Preset from "@docusaurus/preset-classic" import type { Config } from "@docusaurus/types" -console.log("THE API KEY LENGTH IS:", process.env.INKEEP_API_KEY?.length) +console.log( + "THE API KEY LENGTH in the docusaurus config is:", + process.env.INKEEP_API_KEY?.length, +) const baseUrl = "/" From a975d9359b19f0f5647430ba29f9eae400d80a09 Mon Sep 17 00:00:00 2001 From: sarah_inkeep Date: Mon, 14 Apr 2025 15:09:07 -0700 Subject: [PATCH 7/7] Remove test files --- .github/workflows/algolia.yaml | 44 +++++++++++++++++----------------- .github/workflows/build.yaml | 38 ----------------------------- 2 files changed, 22 insertions(+), 60 deletions(-) delete mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/algolia.yaml b/.github/workflows/algolia.yaml index 0bcba9a0..9e18d8aa 100644 --- a/.github/workflows/algolia.yaml +++ b/.github/workflows/algolia.yaml @@ -1,25 +1,25 @@ # generate a workflow that triggers in push to main -# name: Algolia Re-crawler +name: Algolia Re-crawler -# on: -# push: -# branches: -# - main -# workflow_dispatch: +on: + push: + branches: + - main + workflow_dispatch: -# jobs: -# algolia_recrawl: -# runs-on: ubuntu-latest -# steps: -# - name: Sleep for 120s -# run: sleep 120 -# - name: Algolia crawler creation and crawl -# uses: algolia/algoliasearch-crawler-github-actions@v1.0.10 -# id: algolia_crawler -# with: # mandatory parameters -# crawler-user-id: ${{ secrets.CRAWLER_USER_ID }} -# crawler-api-key: ${{ secrets.CRAWLER_API_KEY }} -# algolia-app-id: ${{ secrets.ALGOLIA_APP_ID }} -# algolia-api-key: ${{ secrets.ALGOLIA_API_KEY }} -# crawler-name: coderabbit -# site-url: "https://docs.coderabbit.ai" +jobs: + algolia_recrawl: + runs-on: ubuntu-latest + steps: + - name: Sleep for 120s + run: sleep 120 + - name: Algolia crawler creation and crawl + uses: algolia/algoliasearch-crawler-github-actions@v1.0.10 + id: algolia_crawler + with: # mandatory parameters + crawler-user-id: ${{ secrets.CRAWLER_USER_ID }} + crawler-api-key: ${{ secrets.CRAWLER_API_KEY }} + algolia-app-id: ${{ secrets.ALGOLIA_APP_ID }} + algolia-api-key: ${{ secrets.ALGOLIA_API_KEY }} + crawler-name: coderabbit + site-url: "https://docs.coderabbit.ai" diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index 59a42865..00000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: Build and Test Docusaurus - -on: - push: - branches: [debug-env] # adjust as needed - -jobs: - build: - runs-on: ubuntu-latest - env: - INKEEP_API_KEY: ${{ secrets.INKEEP_API_KEY }} - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: 22 # or your preferred version - - - name: Install dependencies - run: npm install - - # Debug step to verify the environment variable is set. - - name: Verify INKEEP_API_KEY is set - run: | - echo "Verifying environment variable..." - if [ -z "$INKEEP_API_KEY" ]; then - echo "Error: INKEEP_API_KEY is NOT set" - exit 1 - else - echo "Success: INKEEP_API_KEY is set" - # Optional: Print out the length of the key instead of the key itself. - echo "The key has ${#INKEEP_API_KEY} characters." - fi - - - name: Build Docusaurus site - run: npm run build