mirror of
https://github.com/lancedb/lancedb.git
synced 2026-06-01 11:20:44 +00:00
95 lines
3.0 KiB
YAML
95 lines
3.0 KiB
YAML
name: Codex Update Lance Dependency
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
tag:
|
|
description: "Tag name from Lance. If omitted, the skill will use the latest Lance release that needs an update."
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: "Tag name from Lance. Leave empty to use the latest Lance release that needs an update."
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
actions: read
|
|
|
|
jobs:
|
|
update:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Show inputs
|
|
run: |
|
|
echo "tag = ${{ inputs.tag || 'latest' }}"
|
|
|
|
- name: Checkout Repo LanceDB
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: true
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: Install Codex CLI
|
|
run: npm install -g @openai/codex
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: stable
|
|
components: clippy, rustfmt
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y protobuf-compiler libssl-dev
|
|
|
|
- name: Install cargo-info
|
|
run: cargo install cargo-info
|
|
|
|
- name: Install Python dependencies
|
|
run: python3 -m pip install --upgrade pip packaging
|
|
|
|
- name: Configure git user
|
|
run: |
|
|
git config user.name "lancedb automation"
|
|
git config user.email "robot@lancedb.com"
|
|
|
|
- name: Run Codex to update Lance dependency
|
|
env:
|
|
TAG: ${{ inputs.tag }}
|
|
GITHUB_TOKEN: ${{ secrets.ROBOT_TOKEN }}
|
|
GH_TOKEN: ${{ secrets.ROBOT_TOKEN }}
|
|
OPENAI_API_KEY: ${{ secrets.CODEX_TOKEN }}
|
|
run: |
|
|
set -euo pipefail
|
|
TARGET_TAG="${TAG:-latest}"
|
|
|
|
cat <<EOF >/tmp/codex-prompt.txt
|
|
You are running inside the lancedb repository on a GitHub Actions runner.
|
|
|
|
Read and use the in-repository skill at "skills/lancedb-update-lance-dependency/SKILL.md".
|
|
Update LanceDB's Lance dependency for target "${TARGET_TAG}" and create a pull request targeting "main" if an update is needed.
|
|
|
|
Constraints:
|
|
- Use env "GH_TOKEN" for GitHub operations.
|
|
- Do not merge the pull request.
|
|
- Do not force-push.
|
|
- Do not create a duplicate pull request if an open PR already exists for the target Lance version.
|
|
- If any command fails, diagnose and fix the root cause instead of aborting.
|
|
- After creating the PR, display the PR URL, "git status --short", and a concise summary of the commands run and their results.
|
|
EOF
|
|
|
|
printenv OPENAI_API_KEY | codex login --with-api-key
|
|
codex --config shell_environment_policy.ignore_default_excludes=true exec --dangerously-bypass-approvals-and-sandbox "$(cat /tmp/codex-prompt.txt)"
|