Skip to content

Update pre-commit hook renovatebot/pre-commit-hooks to v39.164.1 #207

Update pre-commit hook renovatebot/pre-commit-hooks to v39.164.1

Update pre-commit hook renovatebot/pre-commit-hooks to v39.164.1 #207

---
name: OpenAI Generate PR Title and Description
on:
pull_request:
branches:
- main
types:
- opened
- synchronize
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
generate-pr-description:
runs-on: ubuntu-latest
timeout-minutes: 10
# Check if the PR is not created by 'renovate' or 'tqer39-apps'
if: contains(fromJSON('["renovate[bot]", "tqer39-apps[bot]"]'), github.event.pull_request.user.login) == false
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # 全ての履歴を取得するように設定
- name: Set up Python
uses: actions/setup-python@v5
- name: pip upgrade
run: python -m pip install --upgrade pip
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.26"
- name: Setup uv
run: |
uv venv
source .venv/bin/activate
uv sync --no-dev
shell: bash
- name: Generate PR Title and Description
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_MODEL: "gpt-4o"
COMMIT_LOG_HISTORY_LIMIT: 70
run: |
uv run scripts/generate_pr_description.py > pr_output.txt
cat pr_output.txt
- name: Update PR Title and Description
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
PR_TITLE=$(head -n 1 pr_output.txt)
PR_BODY=$(tail -n +2 pr_output.txt)
gh pr edit $PR_NUMBER --title "$PR_TITLE" --body "$PR_BODY"