create a dated branch before pushing

This commit is contained in:
oskar 2026-07-13 18:59:37 +07:00
parent bd79d9cd9c
commit 7b83f1835f
No known key found for this signature in database
GPG key ID: 0D4D9DF6394A1381

View file

@ -26,14 +26,18 @@ jobs:
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 }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add model_prices_and_context_window.json
git commit -m "Update model_prices_and_context_window.json file: $(date +'%Y-%m-%d')"
BRANCH_NAME="auto-update-price-and-context-window-$(date +'%Y-%m-%d')"
git checkout -b "${BRANCH_NAME}"
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}"
gh pr create --title "Update model_prices_and_context_window.json file" \
--body "Automated update for model_prices_and_context_window.json" \
--head auto-update-price-and-context-window-$(date +'%Y-%m-%d') \
--head "${BRANCH_NAME}" \
--base main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}