Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix: version bump workflow creates PR instead of direct push

LearningCircuite7b4f8e46672
diff --git a/.github/workflows/version_check.yml b/.github/workflows/version_check.yml
index b25de41dd3..b46b500fe4 100644
--- a/.github/workflows/version_check.yml
+++ b/.github/workflows/version_check.yml
@@ -1,10 +1,12 @@
name: Version Auto-Bump
-# Run AFTER merge to main, not during PR checks
+# Run AFTER merge to main, creates a PR for version bump
# Benefits:
+# - Respects branch protection rules (no direct push to main)
# - PR checks run once without restarts
# - No version merge conflicts between parallel PRs
-# - Version always reflects what's actually in main
+# - Version bumps are visible and reviewable
+# - Uses fixed branch name to avoid clutter
on:
push:
branches:
@@ -27,6 +29,7 @@ jobs:
if: "!contains(github.event.head_commit.message, 'chore: auto-bump version')"
permissions:
contents: write
+ pull-requests: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
@@ -70,27 +73,63 @@ jobs:
run: |
pdm self add pdm-bump
- - name: Auto-bump patch version
+ - name: Auto-bump patch version and create PR
if: steps.check.outputs.needs_bump == 'true'
+ env:
+ GH_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
+ BRANCH_NAME="chore/auto-version-bump"
+
# Get current version before bump
- current_version=$(pdm show --version 2>/dev/null || grep -oP '(?<=__version__ = ")[^"]*' src/local_deep_research/__version__.py)
+ current_version=$(grep -oP '(?<=__version__ = ")[^"]*' src/local_deep_research/__version__.py)
echo "Current version: $current_version"
# Bump patch version using pdm-bump
pdm bump patch
# Get new version after bump
- new_version=$(pdm show --version 2>/dev/null || grep -oP '(?<=__version__ = ")[^"]*' src/local_deep_research/__version__.py)
+ new_version=$(grep -oP '(?<=__version__ = ")[^"]*' src/local_deep_research/__version__.py)
echo "New version: $new_version"
# Configure git
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- # Commit and push
+ # Fetch remote branches
+ git fetch origin
+
+ # Delete remote branch if it exists (to start fresh from current main)
+ if git ls-remote --exit-code --heads origin "$BRANCH_NAME" > /dev/null 2>&1; then
+ echo "Deleting existing remote branch $BRANCH_NAME"
+ git push origin --delete "$BRANCH_NAME" || true
+ fi
+
+ # Create and switch to the bump branch
+ git checkout -B "$BRANCH_NAME"
+
+ # Commit changes
git add -A
git commit -m "chore: auto-bump version to $new_version"
- git push
- echo "::notice::Version automatically bumped to $new_version"
+ # Push to the branch
+ git push -u origin "$BRANCH_NAME" --force
+
+ # Check if PR already exists
+ existing_pr=$(gh pr list --head "$BRANCH_NAME" --state open --json number --jq '.[0].number' || echo "")
+
+ if [ -n "$existing_pr" ]; then
+ echo "PR #$existing_pr already exists, it has been updated with new changes"
+ echo "::notice::Updated existing PR #$existing_pr with version $new_version"
+ else
+ # Create new PR
+ pr_url=$(gh pr create \
+ --title "chore: auto-bump version to $new_version" \
+ --body "## Summary
+ - Auto-bump patch version: $current_version → $new_version
+
+ This PR was automatically created by the version bump workflow.
+ Approve and merge to trigger a new release." \
+ --head "$BRANCH_NAME" \
+ --base main)
+ echo "::notice::Created PR: $pr_url for version $new_version"
+ fi