From 79a346f7184d7357475ed9ee0a233f36cc93d14e Mon Sep 17 00:00:00 2001 From: Yuvraj Sarathe Date: Mon, 18 May 2026 22:30:34 +0530 Subject: [PATCH 1/4] readme directory change --- docs/{v1.2.1 => }/README.md | 0 docs/v1.2.1/config/README.md | 134 ------------------------------ docs/v1.2.1/health/README.md | 154 ----------------------------------- docs/v1.2.1/logs/README.md | 143 -------------------------------- docs/v1.2.1/show/README.md | 134 ------------------------------ docs/v1.2.1/watch/README.md | 52 ------------ 6 files changed, 617 deletions(-) rename docs/{v1.2.1 => }/README.md (100%) delete mode 100644 docs/v1.2.1/config/README.md delete mode 100644 docs/v1.2.1/health/README.md delete mode 100644 docs/v1.2.1/logs/README.md delete mode 100644 docs/v1.2.1/show/README.md delete mode 100644 docs/v1.2.1/watch/README.md diff --git a/docs/v1.2.1/README.md b/docs/README.md similarity index 100% rename from docs/v1.2.1/README.md rename to docs/README.md diff --git a/docs/v1.2.1/config/README.md b/docs/v1.2.1/config/README.md deleted file mode 100644 index 18d5ab9..0000000 --- a/docs/v1.2.1/config/README.md +++ /dev/null @@ -1,134 +0,0 @@ -# `kdm config` — Configuration Management - -**Version:** v1.2.1 - -## Overview - -The `kdm config` command group manages KDM CLI configuration, including notification service setup, custom settings, and credential management. Configuration is stored locally using the `conf` package. - -## Syntax - -```bash -kdm config -``` - -## Sub-commands - -### `kdm config setup` - -Interactively sets up the notification service (Discord webhook or Email SMTP). - -**Example:** - -```bash -kdm config setup -``` - -**Interactive Flow:** - -1. Select a notification service: - - **Discord** — Send alerts to a Discord channel via webhook. - - **Email (SMTP)** — Send alerts via email SMTP. - - **None** — Disable notifications. - -2. For **Discord**, you will be prompted for a webhook URL. -3. For **Email**, you will be prompted for SMTP host, port, user, and recipient email. - -**Discord Webhook Setup:** - -1. Open your Discord server settings. -2. Go to **Integrations > Webhooks**. -3. Create a new webhook and choose the alert channel. -4. Copy the webhook URL (must start with `https://discord.com/api/webhooks/`). - -**Email SMTP Setup:** - -| Setting | Default | Description | -|---------|---------|-------------| -| Host | `smtp.gmail.com` | SMTP server address | -| Port | `587` | SMTP port (STARTTLS) | -| User | — | Your email address | -| To | — | Alert recipient email | - -> **Note:** SMTP passwords must be set via the `KDM_SMTP_PASSWORD` environment variable. - ---- - -### `kdm config set ` - -Sets a specific configuration value. - -**Example:** - -```bash -kdm config set alert_cooldown 300 -kdm config set email_port 465 -``` - -**Supported Keys:** - -| Key | Type | Description | -|-----|------|-------------| -| `alert_cooldown` | number | Cooldown period between alerts (seconds) | -| `email_port` | number | SMTP port | -| `notification_service` | string | `discord`, `email`, or `none` | -| `discord_webhook` | string | Discord webhook URL | -| `email_host` | string | SMTP host | -| `email_user` | string | SMTP username | -| `email_to` | string | Alert recipient email | - ---- - -### `kdm config list` - -Lists all current configuration values. - -**Example:** - -```bash -kdm config list -``` - -**Expected Output:** - -``` -Current KDM Configuration: -────────────────────────────────────────────────── - notification_service : discord - discord_webhook : https://discord.com/api/webhooks/... -────────────────────────────────────────────────── - - Note: SMTP passwords must be set via KDM_SMTP_PASSWORD env var. -``` - ---- - -### `kdm config clear` - -Clears all configuration and resets to defaults. - -**Example:** - -```bash -kdm config clear -``` - -**Expected Output:** - -``` -✓ Configuration cleared. -``` - -## Configuration File Location - -Configuration is stored in the default `conf` package location: - -- **macOS:** `~/Library/Application Support/kdm-cli` -- **Linux:** `~/.config/kdm-cli` -- **Windows:** `%APPDATA%\kdm-cli` - -## Common Errors - -- **Invalid webhook URL** — Must match `https://discord.com/api/webhooks//`. -- **Invalid email address** — Must be a valid email format. -- **Invalid port number** — Must be between 1 and 65535. diff --git a/docs/v1.2.1/health/README.md b/docs/v1.2.1/health/README.md deleted file mode 100644 index 4b26df3..0000000 --- a/docs/v1.2.1/health/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# `kdm health` — Health Status - -> **Version:** `v1.2.1` - ---- - -## Overview - -The `kdm health` command checks and reports the health status of Kubernetes pods or Docker containers. It provides a clean, color-coded table with real-time status fetched directly from Docker and Kubernetes clients. - -> **Fix (Issue #1):** -> This command previously returned only a placeholder message. It now displays real health data from Docker containers and Kubernetes pods. - ---- - -# Syntax - -```bash -kdm health -``` - ---- - -# Parameters - -| Parameter | Description | Valid Values | -| :--- | :--- | :--- | -| `target` | The workload type to check | `pods`, `containers`, `all` | - ---- - -# Usage - ---- - -## `kdm health pods` - -Checks the health status of all Kubernetes pods. - -### Example - -```bash -kdm health pods -``` - -### Expected Output - -```text -╭──────┬─────────────────────────────┬─────────┬──────────────────────────────────────╮ -│ TYPE │ NAME │ HEALTH │ DETAILS │ -├──────┼─────────────────────────────┼─────────┼──────────────────────────────────────┤ -│ pod │ node-app-6f65c56b74-7tkvf │ Running │ namespace: default, restarts: 0 │ -│ pod │ nginx-deployment-abc123 │ Failed │ namespace: production, restarts: 5 │ -╰──────┴─────────────────────────────┴─────────┴──────────────────────────────────────╯ -``` - -### Health Indicators - -| Status Color | Meaning | -| :--- | :--- | -| 🟢 Green | `healthy`, `running`, `Running` | -| 🔴 Red | `unhealthy`, `exited`, `Failed` | -| 🟡 Yellow | Other states like `Pending`, `paused` | - -### Use Cases - -- Monitor pod health in real time -- Identify failing services before outages occur - ---- - -## `kdm health containers` - -Checks the health status of all Docker containers. - -### Example - -```bash -kdm health containers -``` - -### Expected Output - -```text -╭───────────┬────────────┬─────────┬───────────────╮ -│ TYPE │ NAME │ HEALTH │ DETAILS │ -├───────────┼────────────┼─────────┼───────────────┤ -│ container │ test-nginx │ running │ Up 8 minutes │ -│ container │ my-app │ exited │ Exited (1) │ -╰───────────┴────────────┴─────────┴───────────────╯ -``` - -### Use Cases - -- Verify container health -- Detect unhealthy or restarting containers - ---- - -## `kdm health all` - -Checks health for both pods and containers in a single command. If one source (Docker or Kubernetes) is unavailable, the other still renders successfully. - -### Example - -```bash -kdm health all -``` - ---- - -### Expected Output (Kubernetes unavailable) - -```text -⚠ Kubernetes unavailable: connect ECONNREFUSED 127.0.0.1:8080 - -╭───────────┬────────────┬─────────┬──────────────╮ -│ TYPE │ NAME │ HEALTH │ DETAILS │ -├───────────┼────────────┼─────────┼──────────────┤ -│ container │ test-nginx │ running │ Up 8 minutes │ -╰───────────┴────────────┴─────────┴──────────────╯ -``` - ---- - -### Expected Output (Both available) - -```text -╭───────────┬───────────────────────────┬─────────┬──────────────────────────────────────╮ -│ TYPE │ NAME │ HEALTH │ DETAILS │ -├───────────┼───────────────────────────┼─────────┼──────────────────────────────────────┤ -│ container │ test-nginx │ running │ Up 8 minutes │ -│ pod │ node-app-6f65c56b74-7tkvf │ Running │ namespace: default, restarts: 0 │ -╰───────────┴───────────────────────────┴─────────┴──────────────────────────────────────╯ -``` - ---- - -# Common Errors - -| Error | Cause | Fix | -| :--- | :--- | :--- | -| `Unknown target` | Invalid target passed | Use `pods`, `containers`, or `all` | -| `No workloads found` | No containers or pods running | Start Docker containers or Kubernetes pods | -| `Docker unavailable` | Docker daemon not running | Run `sudo systemctl start docker` | -| `Kubernetes unavailable` | No cluster connection | Run `minikube start` or configure `kubectl` | - ---- - -# Notes - -- Supports both Docker and Kubernetes environments -- Displays partial results even if one backend fails -- Provides readable CLI tables for faster debugging and monitoring \ No newline at end of file diff --git a/docs/v1.2.1/logs/README.md b/docs/v1.2.1/logs/README.md deleted file mode 100644 index 42ace9a..0000000 --- a/docs/v1.2.1/logs/README.md +++ /dev/null @@ -1,143 +0,0 @@ -# `kdm logs` — Show Logs - -> **Version:** `v1.2.1` - ---- - -## Overview - -The `kdm logs` command retrieves and displays logs from a specified Docker container or Kubernetes pod. Docker is tried first, and Kubernetes is used automatically as a fallback if no matching container is found. - -> **Fix (Issue #1):** -> This command previously returned only a placeholder message. It now fetches real logs from Docker containers with automatic fallback to Kubernetes pods. - ---- - -# Syntax - -```bash -kdm logs -``` - ---- - -# Parameters - -| Parameter | Description | -| :--- | :--- | -| `name` | Container ID prefix, Docker container name, or Kubernetes pod name | - ---- - -# Usage - ---- - -## `kdm logs ` - -Fetches and displays the last 100 lines of logs for the specified workload. - ---- - -### Example (Docker Container) - -```bash -kdm logs test-nginx -``` - -### Expected Output - -```text -✔ Fetching logs for test-nginx... (0.0s) - -/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration -/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ -2026/05/17 06:43:38 [notice] 1#1: nginx/1.31.0 -2026/05/17 06:43:38 [notice] 1#1: start worker processes -``` - ---- - -### Example (Kubernetes Pod) - -```bash -kdm logs node-app-6f65c56b74-7tkvf -``` - -### Expected Output - -```text -✔ Fetching logs for node-app-6f65c56b74-7tkvf... (0.0s) - -Server listening on port 3000 -Connected to database -GET /api/health 200 12ms -``` - ---- - -### Example (Container ID Prefix) - -```bash -kdm logs a1b2c3d4 -``` - ---- - -# How It Works - -```text -Docker containers ──► match found? ──► show logs - │ - ▼ no match -Kubernetes pods ──► match found? ──► show logs - │ - ▼ no match -"No container or pod named X found" -``` - -### Workflow - -1. **Docker First** - - Searches running and stopped containers by ID prefix or container name - -2. **Kubernetes Fallback** - - If no Docker match is found, searches all Kubernetes pods across namespaces - -3. **Error Handling** - - Displays an error if neither Docker nor Kubernetes has a matching workload - ---- - -# Finding the Right Name - -```bash -# List Docker containers -docker ps - -# List Kubernetes pods -kubectl get pods --all-namespaces - -# Or use KDM itself -kdm show containers -kdm show pods -``` - ---- - -# Common Errors - -| Error | Cause | Fix | -| :--- | :--- | :--- | -| `No container or pod named X found` | Name does not match any workload | Use `kdm show containers` or `kdm show pods` | -| `Docker unavailable` | Docker daemon is not running | Run `sudo systemctl start docker` | -| `Failed to fetch logs` | Kubernetes API unreachable | Run `minikube start` or configure `kubectl` | - ---- - -# Notes - -- Automatically falls back from Docker to Kubernetes -- Supports container name and ID prefix matching -- Displays real-time logs directly from workloads -- Retrieves the last 100 log lines for faster debugging \ No newline at end of file diff --git a/docs/v1.2.1/show/README.md b/docs/v1.2.1/show/README.md deleted file mode 100644 index b11e718..0000000 --- a/docs/v1.2.1/show/README.md +++ /dev/null @@ -1,134 +0,0 @@ -# `kdm show` — Show Running Workloads - -**Version:** v1.2.1 - -## Overview - -The `kdm show` command displays information about running workloads — Docker containers, Kubernetes pods, combined runners, or Minikube status. It provides a unified view of your local development environment. - -## Syntax - -```bash -kdm show -``` - -## Parameters - -| Parameter | Description | Valid Values | -|-----------|-------------|--------------| -| `target` | The workload type to display | `runners`, `pods`, `containers`, `minikube` | - -## Sub-commands - -### `kdm show runners` - -Shows a combined view of all running Docker containers and Kubernetes pods in a single table. - -**Example:** - -```bash -kdm show runners -``` - -**Expected Output:** - -``` -┌───────────┬──────────────┬──────────────────────┬─────────┬─────────────────┐ -│ TYPE │ NAME / ID │ NAMESPACE / IMAGE │ STATUS │ NODE / STATE │ -├───────────┼──────────────┼──────────────────────┼─────────┼─────────────────┤ -│ Pod │ nginx-abc12 │ default │ Running │ minikube │ -│ Container │ my-app │ myregistry/app:v1 │ running │ host │ -└───────────┴──────────────┴──────────────────────┴─────────┴─────────────────┘ -``` - -**Use Cases:** - -- Get a quick overview of all services running locally. -- Monitor both Docker and Kubernetes workloads simultaneously. - -**Common Errors:** - -- `Docker is unreachable` — Docker daemon is not running. Start Docker Desktop or `systemctl start docker`. -- `Kubernetes is unreachable` — No kubeconfig found or cluster is down. Check `kubectl cluster-info`. - ---- - -### `kdm show pods` - -Shows all Kubernetes pods in the current namespace. - -**Example:** - -```bash -kdm show pods -``` - -**Expected Output:** - -``` -┌──────────────┬───────────┬─────────┬──────────┬──────────┐ -│ POD NAME │ NAMESPACE │ STATUS │ RESTARTS │ NODE │ -├──────────────┼───────────┼─────────┼──────────┼──────────┤ -│ nginx-abc12 │ default │ Running │ 0 │ minikube │ -│ redis-xyz34 │ default │ Running │ 2 │ minikube │ -└──────────────┴───────────┴─────────┴──────────┴──────────┘ -``` - -**Use Cases:** - -- Inspect pod status and restart counts. -- Identify pods in non-Running states. - ---- - -### `kdm show containers` - -Shows all running Docker containers. - -**Example:** - -```bash -kdm show containers -``` - -**Expected Output:** - -``` -┌────────────┬────────────┬────────────────┬────────┬─────────┐ -│ CONTAINER │ NAME │ IMAGE │ STATUS │ STATE │ -│ ID │ │ │ │ │ -├────────────┼────────────┼────────────────┼────────┼─────────┤ -│ a1b2c3d4e5 │ my-app │ myregistry/app │ Up │ running │ -└────────────┴────────────┴────────────────┴────────┴─────────┘ -``` - -**Use Cases:** - -- List all active containers. -- Verify container states at a glance. - ---- - -### `kdm show minikube` - -Shows the status of Minikube profiles on the local machine. - -**Example:** - -```bash -kdm show minikube -``` - -**Expected Output:** - -``` -┌─────────┬─────────┬─────────┬─────────────┬─────────┐ -│ NAME │ HOST │ KUBELET │ APISERVER │ MESSAGE │ -├─────────┼─────────┼─────────┼─────────────┼─────────┤ -│ default │ Running │ Running │ Running │ │ -└─────────┴─────────┴─────────┴─────────────┴─────────┘ -``` - -**Common Errors:** - -- `Minikube is not installed on this system` — Install Minikube from https://minikube.sigs.k8s.io. diff --git a/docs/v1.2.1/watch/README.md b/docs/v1.2.1/watch/README.md deleted file mode 100644 index 66f6a99..0000000 --- a/docs/v1.2.1/watch/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# `kdm watch` — Live Monitoring - -**Version:** v1.2.1 - -## Overview - -The `kdm watch` command enters a live monitoring mode, continuously updating the terminal with real-time resource usage and status of running Docker containers and Kubernetes pods. Powered by Ink for an interactive terminal UI. - -## Syntax - -```bash -kdm watch -``` - -## Parameters - -This command takes no arguments. - -## Usage - -### `kdm watch` - -Starts a real-time monitoring dashboard. - -**Example:** - -```bash -kdm watch -``` - -**Expected Output:** - -The terminal will display an interactive, auto-refreshing table showing: - -- Container/pod names -- Current resource usage (CPU, memory) -- Health status -- Restart counts - -The view updates automatically. Press `Ctrl+C` to exit. - -**Use Cases:** - -- Continuously monitor service health during development. -- Watch for resource spikes or pod restarts in real time. -- Debug intermittent failures by observing live status changes. - -## Common Errors - -- **No workloads found** — Ensure at least one Docker container or Kubernetes pod is running. -- **Docker daemon not running** — Start Docker Desktop or `systemctl start docker`. -- **Kubernetes context not configured** — Verify with `kubectl cluster-info`. From f6230c00c83a2cc8605a5ef4039ae694322e0c5e Mon Sep 17 00:00:00 2001 From: Yuvraj Sarathe Date: Mon, 18 May 2026 22:31:01 +0530 Subject: [PATCH 2/4] updated changelog.yml --- .github/workflows/changelog.yml | 71 +++++++++++++++++---------------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 19f8959..c1e3ee0 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -9,7 +9,7 @@ on: jobs: generate-changelog: - runs-on: ubuntu-latest # Ensure this is here and aligned + runs-on: ubuntu-latest concurrency: group: auto-changelog-${{ github.ref_name }} @@ -41,43 +41,41 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Scaffold Versioned CLI Documentation System + - name: Generate Flat Version File & Update README env: CHANGELOG: ${{ steps.github_release.outputs.changelog }} run: | VERSION="${{ github.ref_name }}" - TARGET_DIR="docs/${VERSION}" - TEMPLATE_DIR=".github/docs-template" + VERSION_FILE="docs/${VERSION}.md" - # 1. Create the unique versioned directory hierarchy - mkdir -p "$TARGET_DIR" + # 1. Create the standalone version document right in the root of docs/ + echo "# KDM CLI Documentation - ${VERSION}" > "$VERSION_FILE" + echo "Published on: $(date +'%Y-%m-%d')" >> "$VERSION_FILE" + echo "" >> "$VERSION_FILE" + printf '%s\n' "$CHANGELOG" >> "$VERSION_FILE" - # 2. If a core template folder exists, copy its entire structural hierarchy over - if [ -d "$TEMPLATE_DIR" ]; then - shopt -s dotglob nullglob - template_items=("$TEMPLATE_DIR"/*) - if [ ${`#template_items`[@]} -gt 0 ]; then - cp -r "${template_items[@]}" "$TARGET_DIR"/ - fi - # 3. Recursively inject the mandatory Version string into every markdown file copied - find "$TARGET_DIR" -type f -name "*.md" -exec sh -c ' - for file; do - if ! grep -Fq "**Version:** '"$VERSION"'" "$file"; then - printf "\n---\n**Version:** %s\n" "'"$VERSION"'" >> "$file" - fi - done - ' _ {} + - else - # Fallback structure if the template directory isn't initialized yet - mkdir -p "$TARGET_DIR/config" "$TARGET_DIR/health" "$TARGET_DIR/logs" "$TARGET_DIR/show" "$TARGET_DIR/watch" - fi + # 2. Build the new dynamic landing page in a temporary file + TEMP_README=$(mktemp) + + echo "# Documentation (Latest: ${VERSION})" > "$TEMP_README" + echo "" >> "$TEMP_README" + + # 3. Embed the raw content of the new version directly into the README + cat "$VERSION_FILE" >> "$TEMP_README" + + echo "" >> "$TEMP_README" + echo "---" >> "$TEMP_README" + echo "## Version History" >> "$TEMP_README" + echo "" >> "$TEMP_README" - # 4. Generate the dedicated version README.md using the Release Engine Changelog output - VERSION_README="$TARGET_DIR/README.md" - echo -e "# KDM CLI Documentation - ${VERSION}\n" > "$VERSION_README" - echo -e "Published on: $(date +'%Y-%m-%d')\n" >> "$VERSION_README" - printf '%s\n' "$CHANGELOG" >> "$VERSION_README" - printf '\n---\n**Version Information:** %s\n' "$VERSION" >> "$VERSION_README" + # 4. Find all v*.md files, sort them newest to oldest, and link them + for file in $(ls docs/v*.md | sort -V -r); do + V_NAME=$(basename "$file" .md) + echo "* [$V_NAME]($V_NAME.md)" >> "$TEMP_README" + done + + # 5. Overwrite the old main README with the newly built one + mv "$TEMP_README" docs/README.md - name: Commit and Push Changes run: | @@ -85,14 +83,19 @@ jobs: git config --local user.name "github-actions[bot]" git checkout ${{ github.event.repository.default_branch }} + + # ff-only means fast-forward only. It will instantly fail the pull if someone else + # pushed code to main while this action was running, preventing messy merge conflicts. git pull origin ${{ github.event.repository.default_branch }} --ff-only - # Track and stage the entire documentation change block git add docs/ + + # If no files changed, exit cleanly so the runner doesn't crash on an empty commit if git diff --cached --quiet; then echo "No documentation changes to commit." exit 0 fi - git commit -m "docs: auto-scaffold documentation architecture for ${{ github.ref_name }} [skip ci]" - git push origin HEAD:${{ github.event.repository.default_branch }} + # The [skip ci] tag tells GitHub Actions NOT to trigger another workflow run from this automated push + git commit -m "docs: auto-scaffold flat documentation for ${{ github.ref_name }} [skip ci]" + git push origin HEAD:${{ github.event.repository.default_branch }} \ No newline at end of file From 64cc382cf9fcb07fcb5650671d233325f390e2b3 Mon Sep 17 00:00:00 2001 From: Yuvraj Sarathe Date: Mon, 18 May 2026 22:54:25 +0530 Subject: [PATCH 3/4] Enhance changelog workflow with version matching Updated changelog workflow to support additional version formats and improved file handling. --- .github/workflows/changelog.yml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index c1e3ee0..5d4a678 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -5,7 +5,10 @@ on: types: [published] push: tags: - - 'v*.*.*' + - 'v*.*.*' # Matches v1.0.0, v2.14.2, etc. + - '*.*.*' # Matches 1.0.0 (no v prefix) + - 'v*.*.*-*' # Matches v1.0.1-alpha.1, v1.2.0-beta.3, v2.0.0-rc.1 + - '*.*.*-*' # Matches 1.0.1-alpha.1 (no v prefix) jobs: generate-changelog: @@ -68,13 +71,22 @@ jobs: echo "## Version History" >> "$TEMP_README" echo "" >> "$TEMP_README" - # 4. Find all v*.md files, sort them newest to oldest, and link them - for file in $(ls docs/v*.md | sort -V -r); do + # 4. Safely extract, sort, and process all version documentation files + # shopt -s nullglob ensures an unmatched glob pattern expands to nothing rather than its literal string + shopt -s nullglob + + # Ingest all docs/*.md files, filter out README.md, version-sort in reverse chronological order + mapfile -t version_files < <(printf '%s\n' docs/*.md | grep -v '^docs/README\.md$' | sort -V -r) + + # 5. Loop through the array buffer safely without breaking on empty sets or spaces + for file in "${version_files[@]}"; do + # Double check the file exists to catch empty arrays securely + [ -f "$file" ] || continue V_NAME=$(basename "$file" .md) echo "* [$V_NAME]($V_NAME.md)" >> "$TEMP_README" done - # 5. Overwrite the old main README with the newly built one + # 6. Overwrite the main docs/README.md with our cleanly compiled template mv "$TEMP_README" docs/README.md - name: Commit and Push Changes @@ -83,19 +95,14 @@ jobs: git config --local user.name "github-actions[bot]" git checkout ${{ github.event.repository.default_branch }} - - # ff-only means fast-forward only. It will instantly fail the pull if someone else - # pushed code to main while this action was running, preventing messy merge conflicts. git pull origin ${{ github.event.repository.default_branch }} --ff-only git add docs/ - # If no files changed, exit cleanly so the runner doesn't crash on an empty commit if git diff --cached --quiet; then echo "No documentation changes to commit." exit 0 fi - # The [skip ci] tag tells GitHub Actions NOT to trigger another workflow run from this automated push git commit -m "docs: auto-scaffold flat documentation for ${{ github.ref_name }} [skip ci]" - git push origin HEAD:${{ github.event.repository.default_branch }} \ No newline at end of file + git push origin HEAD:${{ github.event.repository.default_branch }} From aa257711a56217d4ca02dc4c81b347652f3c8da8 Mon Sep 17 00:00:00 2001 From: Yuvraj Sarathe Date: Mon, 18 May 2026 22:59:19 +0530 Subject: [PATCH 4/4] Update .github/workflows/changelog.yml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .github/workflows/changelog.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 5d4a678..ec909bd 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -95,7 +95,24 @@ jobs: git config --local user.name "github-actions[bot]" git checkout ${{ github.event.repository.default_branch }} - git pull origin ${{ github.event.repository.default_branch }} --ff-only + git checkout ${{ github.event.repository.default_branch }} + + # Retry fast-forward pull up to 3 times with exponential backoff + max_attempts=3 + attempt=1 + while [ $attempt -le $max_attempts ]; do + if git pull origin ${{ github.event.repository.default_branch }} --ff-only; then + break + fi + if [ $attempt -eq $max_attempts ]; then + echo "ERROR: Failed to fast-forward after $max_attempts attempts" + echo "Manual intervention required - docs/ has conflicts" + exit 1 + fi + echo "Fast-forward failed (attempt $attempt/$max_attempts), retrying in $((2**attempt))s..." + sleep $((2**attempt)) + ((attempt++)) + done git add docs/