| name: Generate Release Notes |
|
|
| on: |
| push: |
| tags: |
| - '*' |
| workflow_dispatch: |
|
|
| env: |
| |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| OPENAI_API_BASE_URL: ${{ secrets.OPENAI_API_BASE_URL }} |
| OPENAI_MODEL: gpt-4.1-mini |
|
|
| jobs: |
| generate_and_push: |
| runs-on: ubuntu-latest |
|
|
| permissions: |
| contents: write |
|
|
| steps: |
| - name: Checkout repository |
| uses: actions/checkout@v4 |
| with: |
| |
| fetch-depth: 0 |
|
|
| - name: Set up Python |
| uses: actions/setup-python@v5 |
| with: |
| python-version: '3.x' |
|
|
| - name: Install Python dependencies |
| run: pip install openai |
|
|
| - name: Run release notes generator script |
| id: generate_notes |
| run: python scripts/release_notes_generator.py |
| env: |
| GITHUB_REPOSITORY: ${{ github.repository }} |
|
|
| - name: Commit and push release notes |
| |
| if: success() && steps.generate_notes.outputs.release_notes_file != '' |
| run: | |
| git config user.name "github-actions[bot]" |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| |
| |
| TAG_NAME="${{ steps.generate_notes.outputs.tag_name }}" |
| RELEASE_FILE="${{ steps.generate_notes.outputs.release_notes_file }}" |
| |
| echo "Committing release notes for tag: $TAG_NAME" |
| echo "File path: $RELEASE_FILE" |
|
|
| git add "$RELEASE_FILE" |
| git commit -m "docs(release): Add release notes for $TAG_NAME" || echo "No changes to commit" |
| git push origin HEAD:main |
|
|