Keep the version-bump PR up to date by re-running on merge conflicts (#9761)
Some checks are pending
Canary / bundle-desktop (push) Blocked by required conditions
Canary / bundle-desktop-intel (push) Blocked by required conditions
Canary / bundle-desktop-linux (push) Blocked by required conditions
Canary / bundle-desktop-windows (push) Blocked by required conditions
Canary / bundle-desktop-windows-cuda (push) Blocked by required conditions
Canary / Release (push) Blocked by required conditions
Cargo Deny / deny (push) Waiting to run
Unused Dependencies / machete (push) Waiting to run
CI / Test and Lint Electron Desktop App (push) Blocked by required conditions
CI / changes (push) Waiting to run
CI / Check Rust Code Format (push) Blocked by required conditions
CI / Build and Test Rust Project (push) Blocked by required conditions
CI / Build Rust Project on Windows (push) Waiting to run
CI / Check MSRV (push) Blocked by required conditions
CI / Lint Rust Code (push) Blocked by required conditions
CI / Check Generated Schemas are Up-to-Date (push) Blocked by required conditions
Deploy Documentation / deploy (push) Waiting to run
Create Minor Release PR / check-version-bump-pr (push) Waiting to run
Create Minor Release PR / release (push) Blocked by required conditions
Live Provider Tests / check-fork (push) Waiting to run
Live Provider Tests / changes (push) Blocked by required conditions
Live Provider Tests / Build Binary (push) Blocked by required conditions
Live Provider Tests / Smoke Tests (push) Blocked by required conditions
Live Provider Tests / Smoke Tests (Code Execution) (push) Blocked by required conditions
Live Provider Tests / Compaction Tests (push) Blocked by required conditions
Canary / Prepare Version (push) Waiting to run
Canary / build-cli (push) Blocked by required conditions
Canary / Upload Install Script (push) Blocked by required conditions
Live Provider Tests / goose server HTTP integration tests (push) Blocked by required conditions
Publish Ask AI Bot Docker Image / docker (push) Waiting to run
Publish Docker Image / docker (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run

This commit is contained in:
Jack Amadeo 2026-06-17 11:43:23 -04:00 committed by GitHub
parent 402afa5a8c
commit 184f9efda2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 114 additions and 52 deletions

View file

@ -25,64 +25,77 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: main
fetch-depth: 0
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: main
fetch-depth: 0
- uses: cashapp/activate-hermit@e49f5cb4dd64ff0b0b659d1d8df499595451155a # v1
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- uses: cashapp/activate-hermit@e49f5cb4dd64ff0b0b659d1d8df499595451155a # v1
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- name: install dependencies
run: |
sudo apt update -y
sudo apt install -y libdbus-1-dev gnome-keyring libxcb1-dev
- name: install dependencies
run: |
sudo apt update -y
sudo apt install -y libdbus-1-dev gnome-keyring libxcb1-dev
- name: Compute version and create bump branch
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
TETRATE_API_KEY: ${{ secrets.TETRATE_API_KEY }}
run: |
VERSION=$(just get-next-minor-version)
echo "version=$VERSION" >> $GITHUB_ENV
echo "Version: $VERSION (minor bump on main)"
- name: Compute version and create bump branch
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
TETRATE_API_KEY: ${{ secrets.TETRATE_API_KEY }}
run: |
VERSION=$(just get-next-minor-version)
echo "version=$VERSION" >> $GITHUB_ENV
echo "Version: $VERSION (minor bump on main)"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
BRANCH_NAME="version-bump/$VERSION"
git switch -c "$BRANCH_NAME"
BRANCH_NAME="version-bump/$VERSION"
git switch -C "$BRANCH_NAME"
just prepare-release $VERSION
just prepare-release $VERSION
echo "branch_name=$BRANCH_NAME" >> $GITHUB_ENV
echo "branch_name=$BRANCH_NAME" >> $GITHUB_ENV
- name: Push bump branch
run: |
git push origin "${{ env.branch_name }}"
- name: Push bump branch
run: |
git push --force-with-lease origin "${{ env.branch_name }}"
- name: Create Pull Request
run: |
PR_BODY=$(cat <<'EOF'
Bumps version to **${{ env.version }}**.
- name: Create Pull Request if needed
run: |
EXISTING_PR_URL=$(gh pr list \
--base main \
--head "${{ env.branch_name }}" \
--state open \
--json url \
--jq '.[0].url // empty')
**Please follow these steps:**
if [ -n "$EXISTING_PR_URL" ]; then
echo "Existing PR found: $EXISTING_PR_URL"
echo "pr_url=$EXISTING_PR_URL" >> $GITHUB_ENV
exit 0
fi
1. Close and reopen this PR to trigger CI checks. Reason: workflows don't run on PRs opened by `GITHUB_TOKEN` ([docs](https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow)).
2. Review and resolve any merge conflicts.
3. Approve and merge this PR.
4. The `release/${{ env.version }}` PR will be created automatically.
EOF
)
PR_URL=$(gh pr create \
-B main \
-H "${{ env.branch_name }}" \
--title "chore(release): bump version to ${{ env.version }} (minor)" \
--body "$PR_BODY")
echo "pr_url=$PR_URL" >> $GITHUB_ENV
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_BODY=$(cat <<'EOF'
Bumps version to **${{ env.version }}**.
**Please follow these steps:**
1. Close and reopen this PR to trigger CI checks. Reason: workflows don't run on PRs opened by `GITHUB_TOKEN` ([docs](https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow)).
2. Review and resolve any merge conflicts.
3. Approve and merge this PR.
4. The `release/${{ env.version }}` PR will be created automatically.
EOF
)
PR_URL=$(gh pr create \
-B main \
-H "${{ env.branch_name }}" \
--title "chore(release): bump version to ${{ env.version }} (minor)" \
--body "$PR_BODY")
echo "pr_url=$PR_URL" >> $GITHUB_ENV
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -6,12 +6,61 @@ permissions:
on:
schedule:
- cron: '0 0 * * 2'
- cron: "0 0 * * 2"
workflow_dispatch:
push:
branches:
- main
jobs:
check-version-bump-pr:
if: github.repository == 'aaif-goose/goose' && github.event_name == 'push'
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.check.outputs.should_run }}
steps:
- name: Check for conflicted version bump PR
id: check
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for attempt in 1 2 3 4 5 6; do
CONFLICTING_PR_URLS=$(gh pr list \
--repo "$GITHUB_REPOSITORY" \
--base main \
--state open \
--search 'head:version-bump/' \
--json mergeStateStatus,url \
--jq '.[] | select(.mergeStateStatus == "DIRTY") | .url')
UNKNOWN_COUNT=$(gh pr list \
--repo "$GITHUB_REPOSITORY" \
--base main \
--state open \
--search 'head:version-bump/' \
--json mergeStateStatus \
--jq '[.[] | select(.mergeStateStatus == "UNKNOWN")] | length')
if [ -n "$CONFLICTING_PR_URLS" ] || [ "$UNKNOWN_COUNT" = "0" ]; then
break
fi
echo "Waiting for GitHub to compute PR mergeability (attempt $attempt)..."
sleep 10
done
if [ -n "$CONFLICTING_PR_URLS" ]; then
echo "Found conflicted version bump PR(s):"
echo "$CONFLICTING_PR_URLS"
echo "should_run=true" >> "$GITHUB_OUTPUT"
else
echo "No conflicted version bump PR found."
echo "should_run=false" >> "$GITHUB_OUTPUT"
fi
release:
if: github.repository == 'aaif-goose/goose'
needs: check-version-bump-pr
if: always() && github.repository == 'aaif-goose/goose' && (github.event_name != 'push' || needs.check-version-bump-pr.outputs.should_run == 'true')
uses: ./.github/workflows/create-version-bump-pr.yaml
secrets:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}