Update Contribution Overview #702
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: Update Contribution Overview | |
| on: | |
| schedule: | |
| - cron: "0 18 * * *" # 6am PST | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| update-chart: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Get current week | |
| id: date | |
| run: echo "week=$(date +'%G-W%V')" >> $GITHUB_OUTPUT | |
| - name: Cache shared directories | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .cache | |
| .cache-ai | |
| key: shared-cache-${{ runner.os }}-${{ steps.date.outputs.week }} | |
| restore-keys: | | |
| shared-cache-${{ runner.os }}- | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Run script | |
| run: bun scripts/generate-weekly-overview.ts | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }} | |
| OPENAI_API_KEY: ${{ secrets.TSCIRCUIT_BOT_OPENAI_KEY }} | |
| - name: Commit changes | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add contribution-overviews | |
| git add README.md | |
| git add pr-analysis | |
| git diff --quiet && git diff --staged --quiet || git commit -m "Update contribution overviews" | |
| - name: Push changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: main |