|
| 1 | +name: Changelog Agent |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + # Run every Saturday at 00:00 UTC |
| 6 | + - cron: '0 0 * * 6' |
| 7 | + workflow_dispatch: # Allow manual triggering |
| 8 | + |
| 9 | +jobs: |
| 10 | + generate-changelog: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + steps: |
| 14 | + - name: Checkout repository |
| 15 | + uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 18 | + fetch-depth: 0 # Fetch full history for git operations |
| 19 | + |
| 20 | + - name: Setup Node.js |
| 21 | + uses: actions/setup-node@v4 |
| 22 | + with: |
| 23 | + node-version: '22' |
| 24 | + cache: 'npm' |
| 25 | + |
| 26 | + - name: Setup Bun |
| 27 | + uses: oven-sh/setup-bun@v2 |
| 28 | + with: |
| 29 | + bun-version: latest |
| 30 | + |
| 31 | + - name: Install dependencies |
| 32 | + working-directory: agents/changelog |
| 33 | + run: bun install |
| 34 | + |
| 35 | + - name: Generate changelog |
| 36 | + env: |
| 37 | + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 38 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 39 | + run: | |
| 40 | + cd agents/changelog |
| 41 | + bun index.ts generate |
| 42 | +
|
| 43 | + - name: Check for changes |
| 44 | + id: check-changes |
| 45 | + run: | |
| 46 | + if [ -n "$(git status --porcelain)" ]; then |
| 47 | + echo "changes=true" >> $GITHUB_OUTPUT |
| 48 | + else |
| 49 | + echo "changes=false" >> $GITHUB_OUTPUT |
| 50 | + fi |
| 51 | +
|
| 52 | + - name: Create Pull Request |
| 53 | + if: steps.check-changes.outputs.changes == 'true' |
| 54 | + uses: peter-evans/create-pull-request@v6 |
| 55 | + with: |
| 56 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + commit-message: "chore: update changelog [skip ci]" |
| 58 | + title: "🤖 Automated changelog update" |
| 59 | + body: | |
| 60 | + This PR contains automated changelog updates generated by the changelog agent. |
| 61 | +
|
| 62 | + **Generated on:** ${{ github.event_name == 'workflow_dispatch' && 'Manual trigger' || 'Scheduled run' }} |
| 63 | + **Triggered by:** ${{ github.actor }} |
| 64 | +
|
| 65 | + The changelog agent has analyzed recent commits and pull requests to update the changelog with the latest changes. |
| 66 | + branch: chore/update-changelog-${{ github.run_id }} |
| 67 | + delete-branch: true |
| 68 | + labels: | |
| 69 | + automated |
| 70 | + changelog |
| 71 | + assignees: evantahler |
0 commit comments