Generate Daily Changelog #102
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Generate Daily Changelog | |
| on: | |
| schedule: | |
| # Run at 06:32 UTC daily | |
| - cron: '32 6 * * *' | |
| workflow_dispatch: # Allow manual trigger | |
| permissions: | |
| contents: write | |
| issues: read | |
| pull-requests: write | |
| jobs: | |
| generate-changelog: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch all history for git log | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Install ai-tools package | |
| run: | | |
| cd ai-tools | |
| uv pip install --system -e . | |
| - name: Generate changelog | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| generate-changelog | |
| - name: Get current date | |
| id: date | |
| run: echo "date=$(date -u +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" | |
| - name: Stage changelog changes | |
| run: | | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git config user.name "github-actions[bot]" | |
| git add changes/ || true | |
| - name: Check for staged changes | |
| id: change_check | |
| run: | | |
| if git diff --staged --quiet; then | |
| echo "changes=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changes=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Create Pull Request for changelog | |
| if: steps.change_check.outputs.changes == 'true' | |
| uses: peter-evans/create-pull-request@v5 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: changelog/daily-${{ github.run_id }} | |
| commit-message: "Generate daily changelog [skip ci]" | |
| title: "Daily changelog [${{ steps.date.outputs.date }}]" | |
| body: "Automated daily changelog generation." | |
| base: main |