Data schema: automate data.* sync from local import to staging and production #100
Workflow file for this run
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: Sync Dependabot bun.lock | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| contents: read | |
| jobs: | |
| sync-bun-lockfile: | |
| if: github.actor == 'dependabot[bot]' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout PR branch | |
| uses: actions/checkout@v7.0.1 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| # Shorter than app/bunfig.toml (5 days) so lockfile sync can keep up with Dependabot. | |
| # We hope Dependabot's own cooldown and review only surface sensible, safe bumps. | |
| - name: Update app bun.lock | |
| if: hashFiles('app/package.json') != '' | |
| working-directory: app | |
| run: bun install --minimum-release-age 172800 | |
| - name: Update processing bun.lock | |
| if: hashFiles('processing/package.json') != '' | |
| working-directory: processing | |
| run: bun install --minimum-release-age 172800 | |
| - name: Commit bun.lock changes | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| [[ -f app/bun.lock ]] && git add app/bun.lock | |
| [[ -f processing/bun.lock ]] && git add processing/bun.lock | |
| if git diff --staged --quiet; then | |
| echo "bun.lock already in sync" | |
| exit 0 | |
| fi | |
| git commit -m "chore(deps): sync bun.lock with package.json" | |
| git push |