run update after checkout

This commit is contained in:
oskar 2026-07-13 19:14:31 +07:00
parent 8f5c123660
commit 6e3b72b68a
No known key found for this signature in database
GPG key ID: 0D4D9DF6394A1381

View file

@ -22,9 +22,6 @@ jobs:
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
version: "0.10.9"
- name: Update JSON Data
run: |
uv run --frozen --with 'aiohttp==3.13.3' python ".github/workflows/auto_update_price_and_context_window_file.py"
- name: Create Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -34,12 +31,13 @@ jobs:
git config user.email "github-actions[bot]@users.noreply.github.com"
BRANCH_NAME="auto-update-price-and-context-window-$(date +'%Y-%m-%d')"
BASE_BRANCH="${{ github.event.repository.default_branch }}"
git fetch origin "${BRANCH_NAME}" || true
git fetch origin "${BASE_BRANCH}" "${BRANCH_NAME}" || true
if git show-ref --verify --quiet "refs/remotes/origin/${BRANCH_NAME}"; then
git checkout -B "${BRANCH_NAME}" "origin/${BRANCH_NAME}"
else
git checkout -b "${BRANCH_NAME}"
git checkout -b "${BRANCH_NAME}" "origin/${BASE_BRANCH}"
fi
uv run --frozen --with 'aiohttp==3.13.3' python ".github/workflows/auto_update_price_and_context_window_file.py"
git add model_prices_and_context_window.json
git commit -m "Update model_prices_and_context_window.json file: $(date +'%Y-%m-%d')"
git push "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "${BRANCH_NAME}"