Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 71 additions & 26 deletions .github/workflows/update-kube-stack-version.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
name: Update Kube-Stack Version
name: Update Kube Stack Version

on:
schedule:
# Run every Monday at 9:00 AM UTC
- cron: '0 9 * * 1'
workflow_dispatch: # Allow manual triggering
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run (check for updates without creating PR)'
required: false
default: false
type: boolean

jobs:
update-kube-stack-version:
Expand All @@ -15,47 +21,86 @@ jobs:
uses: actions/checkout@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}

fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Set up Git configuration

- name: Install dependencies
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"

- name: Run kube-stack version update script
python -m pip install --upgrade pip
pip install requests

- name: Run update script
id: update-script
run: |
cd scripts
python update_kube_stack_version.py --prepare-git

echo "Running kube-stack-version update script..."
python scripts/update_kube_stack_version.py
echo "Script completed successfully"

- name: Check for changes
id: verify-changed-files
id: check-changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
if git diff --quiet HEAD -- docset.yml; then
echo "No changes detected in docset.yml"
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
echo "Changes detected in docset.yml"
echo "has_changes=true" >> $GITHUB_OUTPUT

# Show the diff for logging
echo "Changes:"
git diff HEAD -- docset.yml
fi

- name: Create Pull Request
if: steps.verify-changed-files.outputs.changed == 'true'
if: steps.check-changes.outputs.has_changes == 'true' && github.event.inputs.dry_run != 'true'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: update kube-stack version"
title: "chore: update kube-stack version"
commit-message: 'chore: update kube-stack-version'
title: 'chore: update kube-stack-version'
body: |
This PR automatically updates the kube-stack version in `docset.yml` based on the latest version from the elastic-agent repository.
This PR automatically updates the `kube-stack-version` in `docset.yml` based on the latest version from the elastic-agent repository.

**Changes:**
- Updated kube-stack version in docset.yml
- Updated `kube-stack-version` to the latest value from elastic-agent repository

**Generated by:** [Update Kube Stack Version workflow](https://github.com/${{ github.repository }}/actions/workflows/update-kube-stack-version.yml)

This PR was created automatically by the weekly kube-stack version update workflow.
branch: update-kube-stack-version-${{ github.run_id }}
This is an automated update. Please review the changes before merging.
branch: update-kube-stack-version
delete-branch: true
labels: |
automated
documentation
chore
kube-stack-version

- name: Dry run summary
if: github.event.inputs.dry_run == 'true'
run: |
echo "## Dry Run Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ steps.check-changes.outputs.has_changes }}" == "true" ]; then
echo "✅ **Changes detected** - A PR would be created in a real run" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Changes that would be made:**" >> $GITHUB_STEP_SUMMARY
echo '```diff' >> $GITHUB_STEP_SUMMARY
git diff HEAD -- docset.yml >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
else
echo "ℹ️ **No changes needed** - kube-stack-version is already up to date" >> $GITHUB_STEP_SUMMARY
fi

- name: Summary
if: github.event.inputs.dry_run != 'true'
run: |
echo "## Update Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ steps.check-changes.outputs.has_changes }}" == "true" ]; then
echo "✅ **PR Created** - Changes detected and pull request created" >> $GITHUB_STEP_SUMMARY
else
echo "ℹ️ **No changes needed** - kube-stack-version is already up to date" >> $GITHUB_STEP_SUMMARY
fi
2 changes: 1 addition & 1 deletion docset.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
project: 'Elastic documentation'
max_toc_depth: 2

Expand Down Expand Up @@ -295,5 +295,5 @@
intake-apis: https://www.elastic.co/docs/api/doc/observability-serverless/
models-app: "Trained Models"
agent-builder: "Elastic Agent Builder"
kube-stack-version: 0.6.3
kube-stack-version: 0.9.1

Loading